This repository has been archived by the owner on Jul 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwebpack.config.js
83 lines (77 loc) · 1.56 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
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
82
83
const { resolve } = require('path')
const Webpack = require('webpack')
const port = process.env.APP_PORT || 4044
const dist = resolve(__dirname, 'dist')
const src = resolve(__dirname, 'app')
module.exports = {
entry: {
app: [ resolve(src, 'app.ts') ]
},
output: {
filename: 'bundle.js',
path: dist,
publicPath: '/'
},
devtool: 'eval',
node: {
fs: 'empty'
},
devServer: {
hot: true,
contentBase: src,
port: port,
publicPath: '/',
historyApiFallback: true,
disableHostCheck: true,
stats: {
assets: true,
children: false,
chunks: false,
hash: false,
modules: false,
publicPath: false,
timings: true,
version: false,
warnings: true,
colors: {
green: '\u001b[32m'
}
}
},
module: {
rules: [
{
test: /\.ts(x?)$/,
loader: 'ts-loader',
exclude: /node_modules/,
options: {
appendTsSuffixTo: [ /\.vue$/ ]
}
},
{
test: /\.vue$/,
loader: 'vue-loader',
options: {
loaders: {
css: 'vue-style-loader!css-loader'
}
}
},
{
test: /\.css$/,
loaders: [ 'style-loader', 'css-loader?importLoader=1&localIdentName=[name]__[local]__[hash:base64:5]' ]
},
{
test: /\.html$/,
loader: 'html-loader'
}
]
},
resolve: {
extensions: [ '.js', '.ts' ],
alias: {
vue$: 'vue/dist/vue.common.js'
}
},
plugins: [ new Webpack.HotModuleReplacementPlugin() ]
}