forked from yiisoft/yii2-app-basic
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.js
41 lines (37 loc) · 930 Bytes
/
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
const path = require('path');
const webpack = require( 'webpack' );
const PATHS = {
source: path.join(__dirname, 'src'),
build: path.join(__dirname, 'web')
};
const { VueLoaderPlugin } = require('vue-loader');
module.exports = (env, argv) => {
let config = {
production: argv.mode === 'production'
};
return {
mode: 'development',
entry: [
'./src/app.js'
],
output: {
path: PATHS.build,
filename: config.production ? 'app.min.js' : 'app.js'
},
module: {
rules: [
{
test: /\.vue$/,
use: 'vue-loader'
},
{
test: /\.css$/,
loader: ['style-loader', 'css-loader']
}
]
},
plugins: [
new VueLoaderPlugin()
]
};
};