This is my production webpack config. The two quotes in the title refer to webpack2 and webpack respectively. Both hang for me with a similar error.
This is my command to trigger the build
set NODE_ENV=production && webpack --config config/webpack.config.prod.js --progress --display-error-details
What am I missing?
Here is the output after running npm run pack
which correlates to my production webpack build:
$ npm run pack
> somedir@ pack C:\somedir
> set NODE_ENV=production && webpack --config config/webpack.config.prod.js --progress --display-error-details
95% emitting
So I figured this out. It turns out I was including reserved characters in my output path. I've since opened an issue on github.
When using an invalid or reserved character in the output.path webpack will hang with no output. Running with the --progress flag will show that it's hanging on 95% emit(ting) (suffix depending on webpack version).
In my case (Windows environment and laravel-mix) there weren't any incorrect characters in the path, since even a dead simple configuration didn't work. It was just webpack ([email protected]) doing something stupid of his own and the problem has been solved using publicPath
option like this:
mix.options({
publicPath: ('./')
});
which according to the documentation:
allows you to specify the base path for all the assets within your application
Alternatively you can use:
mix.setPublicPath('./');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With