Skip to content

Commit 4585edb

Browse files
committed
Fixed webpack config
1 parent e1a2047 commit 4585edb

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

webpack.mix.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ const path = require('path');
1111
| file for the application as well as bundling up all the JS files.
1212
|
1313
*/
14-
15-
mix.webpackConfig({
14+
let config = {
1615
resolve: {
1716
alias: {
1817
'config': 'assets/js/config',
@@ -28,7 +27,18 @@ mix.webpackConfig({
2827
path.resolve(__dirname, "resources")
2928
]
3029
},
31-
});
30+
}
31+
32+
if (!process.argv.includes('--hot')) {
33+
config = Object.assign(config, {
34+
output: {
35+
publicPath: "/",
36+
chunkFilename: 'js/[name].[chunkhash].js'
37+
}
38+
})
39+
}
40+
41+
mix.webpackConfig(config)
3242

3343
let themes = [
3444
'resources/assets/sass/themes/default-theme.scss',
@@ -45,11 +55,5 @@ mix.js('resources/assets/js/app.js', 'public/js')
4555
.sass('resources/assets/sass/home.scss', 'public/css')
4656

4757
if (mix.inProduction()) {
48-
mix.webpackConfig({
49-
output: {
50-
publicPath: "/",
51-
chunkFilename: 'js/[name].[chunkhash].js'
52-
}
53-
})
5458
mix.version()
5559
}

0 commit comments

Comments
 (0)