-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lambda-nodejs): cannot bundle when entry file is named index.ts #9724
Conversation
Do not rename the dist file if it's already named `index.js`. Fixes aws#9709
@@ -168,7 +168,7 @@ export class Bundling { | |||
// Always rename dist file to index.js because Lambda doesn't support filenames | |||
// with multiple dots and we can end up with multiple dots when using automatic | |||
// entry lookup | |||
`mv ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${distFile} ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/index.js`, | |||
distFile !== 'index.js' ? `mv ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${distFile} ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/index.js` : '', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be less error prone to just have parcel output as index.js? parcel-bundler/parcel#884
Doesn't look like using the entry name has any value and we could remove the parsing on line 155.
distFile !== 'index.js' ? `mv ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/${distFile} ${cdk.AssetStaging.BUNDLING_OUTPUT_DIR}/index.js` : '', | |
'--out-file index.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately --out-file
is a Parcel v1 option, not v2. In v2 you need to configure it in the package.json
but I want to avoid this to allow #9632
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Parcel seems like a pile.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Do not rename the dist file if it's already named
index.js
.Fixes #9709
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license