That header variable contains a header for the console. The weird thing is that when we run npm start, which starts a local server with webpack serve, we get the header twice:
But when we run npm test, the header appears only once:
The weirdest part is that the config file for development doesn't have any other WebpackShellPlugin, but the one for test does. This is the second plugin for webpack.test.js:
So, when we run npm start, with only one WebpackShellPlugin, we get the header twice. And when we run npm test, with two plugins that define, in total, two onBuildStart and one onBuildEnd, we get only one header. And both onBuildStart run exactly once, as expected.
We have our configuration divided among some files:
webpack.common.js
(main config file)webpack.dev.js
(config file for local development)webpack.prod.js
(config file for production build)webpack.tdd.js
(config file for TDD during local development)webpack.test.js
(config file fornpm test
)In
webpack.common.js
we have defined the following usingwebpack-shell-plugin-next
:That
header
variable contains a header for the console. The weird thing is that when we runnpm start
, which starts a local server withwebpack serve
, we get the header twice:But when we run
npm test
, the header appears only once:The weirdest part is that the config file for development doesn't have any other
WebpackShellPlugin
, but the one for test does. This is the second plugin forwebpack.test.js
:So, when we run
npm start
, with only oneWebpackShellPlugin
, we get the header twice. And when we runnpm test
, with two plugins that define, in total, twoonBuildStart
and oneonBuildEnd
, we get only one header. And both onBuildStart run exactly once, as expected.