2017-02-14 06:53:02 +00:00
|
|
|
const mix = require('laravel-mix');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
mix.config.detectHotReloading()
|
|
|
|
if (mix.config.hmr) {
|
|
|
|
// There's a bug with Mix/copy plugin which prevents HMR from working:
|
|
|
|
// https://github.com/JeffreyWay/laravel-mix/issues/150
|
|
|
|
console.log('In HMR mode. If assets are missing, Ctr+C and run `yarn dev` first.');
|
|
|
|
|
|
|
|
// Somehow public/hot isn't being removed by Mix. We'll handle it ourselves.
|
|
|
|
process.on('SIGINT', () => {
|
|
|
|
try {
|
|
|
|
fs.unlinkSync(mix.config.publicPath + '/hot');
|
|
|
|
} catch (e) {}
|
|
|
|
process.exit();
|
|
|
|
});
|
|
|
|
} else {
|
2017-04-15 13:01:14 +00:00
|
|
|
mix.copy('resources/assets/img', 'public/img', false)
|
2017-04-16 01:37:12 +00:00
|
|
|
.copy('node_modules/font-awesome/fonts', 'public/fonts', false);
|
2017-02-14 06:53:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mix.js('resources/assets/js/app.js', 'public/js')
|
|
|
|
.sass('resources/assets/sass/app.scss', 'public/css');
|
|
|
|
|
|
|
|
if (mix.config.inProduction) {
|
|
|
|
mix.version();
|
|
|
|
mix.disableNotifications();
|
|
|
|
}
|