-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.config.js
49 lines (47 loc) · 1.19 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
49
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
module.exports = {
entry: path.join(__dirname, 'src/index.js'),
module: {
rules: [
// load .Vue files
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
// this will apply to both plain `.scss` files
// AND `<style lang="scss">` blocks in `.vue` files
{
test: /\.scss$/,
use: ['vue-style-loader', 'css-loader', 'sass-loader']
}
]
},
plugins: [
// make sure to include the plugin!
new VueLoaderPlugin(),
// process HTML
new HtmlWebpackPlugin({
title: 'Custom template',
template: path.join(__dirname, 'src/index.template.html')
}),
new ScriptExtHtmlWebpackPlugin({
defaultAttribute: 'defer'
})
],
resolve: {
alias: { vue: 'vue/dist/vue.esm.js' },
extensions: ['*', '.js', '.vue', '.json']
},
stats: {
colors: true
},
devtool: '#eval-source-map'
}