chrome-extension-webpack-boilerplate
chrome-extension-webpack-boilerplate copied to clipboard
Show the default ouput of webpack
The default webpack output is nice and informative:
But with running node utils/build.js I only bet:
The boilerplate doesn't change the default Webpack's behavior about the logs, I think that calling webpack()
inside a script doesn't print logs, but I need confirm, and if it's true, we'll need to remove the utils/build.js
in favor to run webpack directly in the package.json
scripts section, but it has some implications because the script creates the extension manifest and remove an invalid webpack key (https://github.com/samuelsimoes/chrome-extension-webpack-boilerplate/issues/9#issuecomment-292739867).
@samuelsimoes @gagarine
calling webpack() inside a script doesn't print logs
somewhat confirmed: https://webpack.js.org/configuration/stats/ : webpack is not using main config.stats
when called from script.
For now build.js
is adding nothing to build process, so it can be omitted in package.json
.
Use
"scripts": {
"build": "webpack",
"start": "node utils/webserver.js"
},
and configure stats
instead of just
"scripts": {
"build": "node utils/build",
"start": "node utils/webserver.js"
},
@rvasilev as pointed on the commit 1529c39dba1bc68d1cc70a45cba49b20687aaf61 the boilerplate uses the build.js script to remove the chromeExtensionBoilerplate
config before send the configs to webpack.
Although I know that it's not a good practice, right now I don't know a
good way to keep the boilerplate configs simple as it is today without
this hacky solution, so, until we came with a better solution, we'll
remove the key before build and webserver's start.
For a quick-ish fix, one thing we could do is to use separate configs, e.g. webpack.config.dev.js and webpack.config.prod.js. These could share webpack.config.shared.js or something.