Respect NODE_ENV in chunks plugin
See original GitHub issueI’ve been experiencing a little problem when running a production build, it seems that the chunks plugin always applies the publicPath from the devServer config:
https://github.com/halt-hammerzeit/universal-webpack/blob/master/source/chunks plugin.js#L56
Am I right, and if so, is this the desired behavior?
We’re solving it manually like so:
webpack.config.js:
{
...other config stuff
devServer: process.env.NODE_ENV === 'production' ? {} : {
...content of devServer config
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Passing environment-dependent variables in webpack
There are two basic ways to achieve this. DefinePlugin. new webpack.DefinePlugin({ 'process.env.NODE_ENV': JSON.stringify(process.env.
Read more >Compilation Hooks | webpack
A plugin can tap into this hook to perform optimizations on chunks. ... The callback must respect the type of the tap method...
Read more >Respect a .nvmrc file · Issue #116 - GitHub
json#engines field to find a matching node. A hypothetical nodenv-nvmrc plugin would be nearly identical: hook into the version lookup, exit ...
Read more >Plugins - esbuild
The plugin API allows you to inject code into various parts of the build process. ... respect conditional package imports in the "import"...
Read more >chunks-webpack-plugin - npm
The ChunksWebpackPlugin creates HTML files with entry points and chunks relations to serve your webpack bundles. It is suitable with multi-page ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Check the new version of the package
Yeah okay. I kinda like that we can add
devServer
to our base config file, and as for webpack, it only gets interpreted by thewebpack-dev-server
command, right? This is what caused my initial confusion, as I was assuming thatdevServer
only gets applied in adev
environment.