-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.client.config.js
59 lines (58 loc) · 1.36 KB
/
webpack.client.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
const path = require('path')
const webpack = require('webpack')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
mode: process.env.NODE_ENV,
entry: [
path.resolve('./client/src/main.js'),
'webpack-hot-middleware/client?noInfo=true&reload=true'
],
output: {
path: path.resolve('dist'),
filename: '[name].js'
},
module: {
rules: [
{
test: /\.vue$/,
loader: "vue-loader",
include: path.resolve('client')
},
{
test: /\.js$/,
loader: "babel-loader",
include: path.resolve('client')
},
{
test: /\.(png|jpg|jpeg|gif|svg)$/,
loader: "url-loader",
options: {
limit: 10000,
esModule: false,
name: 'images/[name]_[hash:7].[ext]'
}
},
{
test: /\.scss$/,
use: ['style-loader', 'css-loader', 'sass-loader'],
exclude: /node_modules/
}
]
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': path.resolve('./client/src')
}
},
plugins: [
new VueLoaderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: path.resolve('./client/template/index.html'),
inject: true
}),
]
}