-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.mix.js
executable file
·39 lines (33 loc) · 1.01 KB
/
webpack.mix.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const mix = require('laravel-mix');
const webpack = require('webpack');
const path = require('path');
let publicPath = '/';
if (mix.inProduction()) {
publicPath = '/public/';
}
mix.webpackConfig({
output: {
publicPath: publicPath,
chunkFilename: 'app/[name].[chunkhash].js',
filename: '[name].js',
},
resolve:{
extensions: ['.js', '.vue'],
alias: {
'root': path.join(__dirname, ''),
'_app': path.join(__dirname, 'resources/js/app'),
'_components': path.join(__dirname, 'resources/js/components'),
'_routes': path.join(__dirname, 'resources/js/routes'),
'_public': path.join(__dirname, 'public')
},
},
});
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
if (mix.inProduction()) {
console.log("============================");
console.log("=== WE ARE IN PRODUCTION ===");
console.log("============================");
console.log('');
mix.version();
}