forked from binxhealth/force-vue-awakens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
36 lines (33 loc) · 940 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
const path = require('path')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const isProduction = process.env.NODE_ENV === 'production'
module.exports = {
mode: isProduction ? 'production' : 'development',
entry: './src/main.js',
output: {
path: path.join(__dirname, 'dist'),
publicPath: '/',
filename: 'js/[name].js'
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': path.join(__dirname, 'src')
}
},
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
{ test: /\.vue$/, loader: 'vue-loader' }
]
},
plugins: [
new VueLoaderPlugin(),
new HtmlWebpackPlugin({ template: './src/index.html' }),
...(process.env.WEBPACK_SERVE ? [] : [
new CleanWebpackPlugin(['dist'])
])
]
}