-
Notifications
You must be signed in to change notification settings - Fork 16
/
webpack.config.js
48 lines (44 loc) · 1.16 KB
/
webpack.config.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
40
41
42
43
44
45
46
47
48
// webpack.config.js
const path = require('path');
const webpack = require('webpack');
const PATHS = {
source: path.join(__dirname, 'resources/js'),
build: path.join(__dirname, 'web')
};
const {VueLoaderPlugin} = require('vue-loader');
module.exports = (env, argv) => {
let config = {
production: argv.mode === 'production'
};
return {
mode: 'development',
entry: [
'./resources/js/app.js'
],
output: {
path: PATHS.build,
filename: config.production ? 'assets/inertia/js/app.min.js' : 'assets/inertia/js/app.js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': '/' + path.resolve(__dirname, 'resources/js')
}
},
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
loader: ['style-loader', 'css-loader']
}
]
},
plugins: [
new VueLoaderPlugin()
]
};
};