Comments (6)
@vadzim Can you provide an example of this?
from aws-sam-webpack-plugin.
Oh.. I thought it's by design..
Ok, I'll try to extract minimal example
from aws-sam-webpack-plugin.
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.
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.
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.
Great work @vadzim
from aws-sam-webpack-plugin.
Related Issues (20)
- Support for DefinitionUri in AWS::Serverless: :StateMachine HOT 8
- Generated template file should always be `template.yaml` HOT 1
- Possible Bug with compiling the webpack code HOT 8
- Can't use ES6 import/export HOT 3
- Best way of building source code when other runtimes exist in the project HOT 1
- Improve webpack build performance HOT 2
- NodeJS14 Support HOT 1
- Debugging on VSCode: payload and env vars? HOT 1
- Support for Node 14 HOT 3
- Multiply write into .aws-sam/template.yaml
- Debugging is broken with VS Code 1.60.0 HOT 5
- build.toml HOT 3
- Build process is breaking GraphQL endpoint when running SAM Local
- Would be possible to watch only one function? HOT 2
- Remove `"module": "commonJS"` in TSConfig Example to support Tree Shaking?
- Question about how to override template parameter during webpack building HOT 2
- Add a tag for Nodejs18.x HOT 2
- SAM deploying TypeScript source code instead of the transpiled JavaScript HOT 2
- Support ES Modules HOT 2
- <Function name> has an unsupport Runtime. Must be nodejs10.x or nodejs12.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sam-webpack-plugin.