Giter Club home page Giter Club logo

serverless-sam-typescript-boilerplate's People

Contributors

borduhh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-sam-typescript-boilerplate's Issues

npm build:prod error

Hi Nick,
amazing tutorial so far.

Yet, almost by the end, when I need to build a Api Function (npm run build:prod) with altered webpack.config.ts I'm getting an error

[webpack-cli] webpack.config.ts:42:14 - error TS2304: Cannot find name 'EventSource'.


42     Events?: EventSource;
                ~~~~~~~~~~~

NOTE: please note that I've picked all the latest devDependencies and here is the list:

    "devDependencies": {
        "@types/aws-lambda": "^8.10.64",
        "@types/jest": "^26.0.15",
        "@types/node": "^14.14.2",
        "@types/webpack": "^4.41.23",
        "@typescript-eslint/eslint-plugin": "^4.5.0",
        "@typescript-eslint/parser": "^4.5.0",
        "eslint": "^7.11.0",
        "eslint-config-prettier": "^6.14.0",
        "eslint-plugin-import": "^2.22.1",
        "eslint-plugin-prettier": "^3.1.4",
        "jest": "^26.6.0",
        "prettier": "^2.1.2",
        "ts-jest": "^26.4.1",
        "ts-loader": "^8.0.6",
        "ts-node": "^9.0.0",
        "typescript": "^4.0.3",
        "webpack": "^5.1.3",
        "webpack-cli": "^4.1.0",
        "yaml-cfn": "^0.2.3"
    }

If I look into ISamFunction interface in that webpack.config.js, all are "primitives" except that Events?: EventSource.
Can it be that it is referenced somewhere? Maybe you have some global npm module installed?

Webpack building devDependencies too

Hello man,
Thanks for the boilerplate.

Let's imagine a scenario where a function uses lodash, we would install lodash dependency in global layer so it can be reused without bloat the function up (many functions use it)
The problem is that functions can't reference the installed module and keep linting "module not found" when coding the function body.
The first workaround was to install lodash as dev dependency in the function folder so lint error stopped, however, when we build to deploy using webpack, the generated JS includes ALL de dev dependency in the function which makes it very heavy and the global layer unecessary.

How can we solve it?
Something about ignore devDependencies when compile?

I have spend many hours trying different solutions but with no luck. Your help would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.