-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwebpack.docs.config.js
More file actions
57 lines (56 loc) · 1.25 KB
/
webpack.docs.config.js
File metadata and controls
57 lines (56 loc) · 1.25 KB
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
50
51
52
53
54
55
56
57
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const path = require('path')
module.exports = {
mode: 'development',
entry: path.join(__dirname, 'src/scripts/index.js'),
output: {
path: path.join(__dirname, 'docs'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.(js|vue)$/,
enforce: 'pre',
use: ['eslint-loader']
},
{
test: /\.js$/,
loader: 'babel-loader'
},
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.sass$/,
loader: 'style-loader!css-loader!sass-loader'
}
]
},
plugins: [
new HtmlWebpackPlugin({
title: 'Vue simple menu demo',
filename: path.join(__dirname, 'docs/index.html'),
template: 'src/index.html'
}),
new VueLoaderPlugin(),
new CleanWebpackPlugin(path.join(__dirname, 'docs'))
],
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
}
},
devServer: {
contentBase: path.join(__dirname, 'docs'),
host: '0.0.0.0',
port: 3030,
open: 'http://localhost:3030/'
},
watchOptions: {
aggregateTimeout: 100
}
}