serverless-webpack
serverless-webpack copied to clipboard
Useless files in externals node_modules ?
This is a Question / Bug Report
Description
Hi, I'm using your great plugin ( to bundle a typescript serverless app.
As explained in the doc, I put externals node_modules :
module.exports = {
// ....
module: {
rules: [
{
test: path.resolve(__dirname, 'node_modules/datauri/index.js'),
loader: 'shebang-loader',
},
{
test: /\.node$/,
loader: 'node-loader',
},
{
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
// disable type checker - we will use it in fork plugin
transpileOnly: true,
experimentalWatchApi: true,
}
}
]
},
externals: [nodeExternals()]
// ...
}
The zip file is huge so I've check what appends and I saw that all files of nodes_modules are zipped : (LICENSE, .md, package.json, .d.ts ...) these files seems to be useless but they are heavy all together.
Do I made something wrong or is it the expected behavior ?
Then if it's the expected behavior, please can you explain me why we need to includes these files in the zip ?
Thank you.
Hi @neilime, is it possible to see the serverless.yml
file for this project too? Specifically the custom.webpack
options?
Same problem. Why does this happen?