Git Product home page Git Product logo

Comments (6)

buggy avatar buggy commented on June 14, 2024

@vadzim Can you provide an example of this?

from aws-sam-webpack-plugin.

vadzim avatar vadzim commented on June 14, 2024

Oh.. I thought it's by design..
Ok, I'll try to extract minimal example

from aws-sam-webpack-plugin.

vadzim avatar vadzim commented on June 14, 2024

https://github.com/vadzim/AwsSamTestData

template.yaml contains a reference to non-existing file Z.js

actions:

  • run npm run build

actual behaviour:

  • command runs successfully and show neither erros nor warnings. It builds one lambda function which has a valid reference to X.js

expected behaviour:

  • command shows some info about wrong entry in template.yaml

In the first commit vadzim/AwsSamTestData@21e78b8 template.yaml contains two valid references to X.js and Y.js and build them both successfully.

from aws-sam-webpack-plugin.

vadzim avatar vadzim commented on June 14, 2024

Here https://github.com/SnappyTutorials/aws-sam-webpack-plugin/blob/570602bebf8d25777dec647c551175ed5c8bec8f/src/index.ts#L97 the code checks if the file with extension .js or .ts exists and creates an entry for webpack only if that file exists. The code just does nothing if the file does not exist. It neither adds some entry nor reports any error.

from aws-sam-webpack-plugin.

vadzim avatar vadzim commented on June 14, 2024

Webpack allows to specify entries without extensions and also specify an option how to resolve files without extensions:

  entry: {
    X: './src/X',
    Y: './src/Y',
  },
  resolve: {
    extensions: ['.ts', '.js'],
  },

I guess to solve the problem it could be enough to just generate entry without either .ts or .js extension, remove any checks for the existing files and let webpack do its work.
In such case webpack will be responsive for error handling if entry is absent.

There is an example which checks that webpack can handle entries without extensions https://github.com/vadzim/AwsSamTestData/tree/WebpackEntryWithoutExtension

from aws-sam-webpack-plugin.

buggy avatar buggy commented on June 14, 2024

Great work @vadzim

from aws-sam-webpack-plugin.

Related Issues (20)

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.