-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.js
81 lines (79 loc) · 2.1 KB
/
webpack.dev.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
73
74
75
76
77
78
79
80
81
var path = require('path')
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const resolve = relativePath => path.resolve(__dirname, '..', relativePath);
module.exports = {
mode: 'development',
entry: {
app: './src/dev.js'
},
devServer: {
hot: true,
watchOptions: {
poll: true
},
historyApiFallback: {
disableDotRule: true
},
//contentBase: "./src/assets/",
contentBase: path.join(__dirname, "/src/assets"),
publicPath: "/dist/",
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new VueLoaderPlugin(),
],
output: {
filename: 'build.js',
path: path.resolve(__dirname, 'dist'),
//publicPath: '/assets',
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
css: ['vue-style-loader', {
loader: 'css-loader',
}],
js: [
'babel-loader',
],
},
cacheBusting: true,
},
},
{
test: /\.js$/,
loader: 'babel-loader',
include: [
resolve('src'),
resolve('node_modules/webpack-dev-server/client'),
],
},
{
test: /\.(png|jpg|gif|svg)$/,
loader: 'url-loader',
options: {
name: '[name].[ext]',
outputPath: '/images/[hash]-[name].[ext]'
}
},
{
test: /\.css$/,
use: [
'vue-style-loader',
'css-loader'
]
},
]
},
resolve: {
alias: {
'vue$': 'vue/dist/vue.common.js'
}
},
};