This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathwebpack.dev.config.js
72 lines (71 loc) · 1.85 KB
/
webpack.dev.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const path = require('path'),
webpack = require('webpack'),
DashboardPlugin = require('webpack-dashboard/plugin');
module.exports = {
devtool: 'eval-source-map',
entry: {
app: [
`webpack-dev-server/client?http://localhost:9008`,
'webpack/hot/dev-server',
'./src/scripts/index.js'],
},
output: {
path: path.join(__dirname, 'dist'),
filename: 'app.js',
publicPath: '/scripts',
},
resolve: {
extensions: ['.js', '.vue'],
modules: [path.join(__dirname, 'node_modules')],
alias: {
vue$: 'vue/dist/vue',
},
},
module: {
rules: [
{
test: /\.js$/,
enforce: 'pre',
loader: 'eslint-loader',
include: path.join(__dirname, 'src'),
exclude: /node_modules/,
},{
test: /\.vue$/,
loader: 'vue-loader',
}, {
test: /\.js$/,
loader: 'babel-loader',
include: path.join(__dirname, 'src'),
exclude: /node_modules/,
}, {
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'scss-loader'],
}, {
test: /\.(jpe?g|png|gif|svg)$/i,
loader: 'url-loader',
}, {
test: /\.json$/,
loader: 'json-loader',
}],
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new DashboardPlugin(),
],
devServer: {
host: '0.0.0.0',
disableHostCheck: true,
contentBase: './build',
publicPath: '/scripts',
hot: true,
historyApiFallback: true,
stats: {
colors: true,
chunks: false,
children: false,
},
headers: {
'Access-Control-Allow-Origin': '*',
},
},
};