Skip to content Skip to sidebar Skip to footer

Webpack Exclude Folder

I'm shoving a rather large app through Webpack, which pulls from two library folders: thirdparty and node_modules. I've setup my rule for js files as such: { test: /\.js$/,

Solution 1:

The rules do not decide which files are being parsed by webpack, but instead they are only applied to the files which are included and also satisfy the condition. Even if you had no rule at all, webpack would still parse the same files since you imported them somewhere.

You can exclude modules from being bundled with the externals option. These externals will have to be present at runtime in some way (for example loaded in a <script> tag).

If you just want webpack not to parse the files, but still include them, you can configure module.noParse. But as the documentation says, they should not contain any imports.


Post a Comment for "Webpack Exclude Folder"