Open hapumee opened 5 years ago
I got that error as well when I added webpack-node-externals. Subsequently removed it and the error is gone. Something weird is going on.
Ah I found the answer. This tool is not meant for projects that run in the browser.
@inspectordanno I don't see this confirmed with the author (@liady).
I found out that externals: [nodeExternals()]
is compatible with mode: 'production'
and target: 'web'
.
So, why not just exclude the mode
property from your webpack config and leave it as its default (production
)?
Excluding externals: [nodeExternals()]
may result in a larger bundle size.
Ugh, I guess it was confirmed by the author in #17
I have just started to study Webpack and trying to setup development environment based on Webpack4.
I put one script for executing dev server in
package.json
like bellow.# package.json
However, there was an error message like bellow when I execute
'npm run dev'
on my terminal.So, I installed
'webpack-node-externals'
and put configuration in'webpack.config.js'
like bellow.# install webpack-node-externals module
# webpack.config.js
When a browser was opened, there was an error on a browser like bellow.
I'm not sure this error is related to
'webpack-node-externals'
module or not, but could I get some guide for solving this situation?