chrome-extension-webpack-boilerplate icon indicating copy to clipboard operation
chrome-extension-webpack-boilerplate copied to clipboard

Show the default ouput of webpack

Open gagarine opened this issue 7 years ago • 4 comments

The default webpack output is nice and informative: screen shot 2017-04-14 at 04 08 42

But with running node utils/build.js I only bet: screen shot 2017-04-14 at 04 09 45

gagarine avatar Apr 14 '17 02:04 gagarine

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 avatar Apr 15 '17 12:04 samuelsimoes

@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 avatar Nov 24 '17 09:11 rvasilev

@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.

samuelsimoes avatar Apr 07 '18 13:04 samuelsimoes

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.

smacke avatar Oct 25 '18 23:10 smacke