Skip to content

Commit

Permalink
Fixed webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
jcc committed Sep 14, 2018
1 parent e1a2047 commit 4585edb
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions webpack.mix.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const path = require('path');
| file for the application as well as bundling up all the JS files.
|
*/

mix.webpackConfig({
let config = {
resolve: {
alias: {
'config': 'assets/js/config',
Expand All @@ -28,7 +27,18 @@ mix.webpackConfig({
path.resolve(__dirname, "resources")
]
},
});
}

if (!process.argv.includes('--hot')) {
config = Object.assign(config, {
output: {
publicPath: "/",
chunkFilename: 'js/[name].[chunkhash].js'
}
})
}

mix.webpackConfig(config)

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

if (mix.inProduction()) {
mix.webpackConfig({
output: {
publicPath: "/",
chunkFilename: 'js/[name].[chunkhash].js'
}
})
mix.version()
}

1 comment on commit 4585edb

@jcc
Copy link
Owner Author

@jcc jcc commented on 4585edb Sep 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.