We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
An option/flag to tell Parcel to ignore a specific require and leave it as-is instead of bundling it.
const options = { // ... ignoreModules: ['aws-sdk'], };
Output file:
const AWS = require('aws-sdk'); // provided from deployment environment // use AWS
No such option exists. All packages are bundled up. Output file:
const AWS = /* embedded AWS SDK source code */; // use AWS
Add the option, so that the given packages are not bundled up.
Parcel is used by AWS CDK to bundle up NodeJS modules for deployment to AWS Lambda.
However, AWS Lambda has a size limit on the uploaded bundle.
But AWS Lambda also provides the require function at runtime, as well as the aws-sdk.
require
aws-sdk
So if Parcel had an option to leave require('aws-sdk') as-is, then I could upload my code to AWS Lambda.
require('aws-sdk')
See above.
The text was updated successfully, but these errors were encountered:
As a workaround you try to "outsmart" Parcel with: 😬
let foo = "aws-sdk"; const AWS = require(foo);
Does this work for you?
ignoreModules: ['aws-sdk']
Parcel 2 has something like that already implemented:
{ "app": "dist/index.js", "targets": { "default": { "includeNodeModules": { "aws-sdk": false } } }, "engines": { "node": ">=10" } }
Sorry, something went wrong.
The workaround works well enough for now, thanks :)
No branches or pull requests
🙋 feature request
An option/flag to tell Parcel to ignore a specific require and leave it as-is instead of bundling it.
🤔 Expected Behavior
Output file:
😯 Current Behavior
No such option exists. All packages are bundled up. Output file:
💁 Possible Solution
Add the option, so that the given packages are not bundled up.
🔦 Context
Parcel is used by AWS CDK to bundle up NodeJS modules for deployment to AWS Lambda.
However, AWS Lambda has a size limit on the uploaded bundle.
But AWS Lambda also provides the
require
function at runtime, as well as theaws-sdk
.So if Parcel had an option to leave
require('aws-sdk')
as-is, then I could upload my code to AWS Lambda.💻 Examples
See above.
The text was updated successfully, but these errors were encountered: