serverless-webpack icon indicating copy to clipboard operation
serverless-webpack copied to clipboard

Useless files in externals node_modules ?

Open neilime opened this issue 6 years ago • 2 comments

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.

neilime avatar Nov 07 '18 21:11 neilime

Hi @neilime, is it possible to see the serverless.yml file for this project too? Specifically the custom.webpack options?

hassankhan avatar Apr 26 '19 01:04 hassankhan

Same problem. Why does this happen?

ivands avatar Aug 09 '19 12:08 ivands