-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
93 lines (84 loc) · 2.04 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
84
85
86
87
88
89
90
91
92
93
const webpack = require('webpack');
var path = require('path');
var config = {
devtool: "source-map",
output: {
path: path.join(__dirname, 'dist'),
filename: '[name].min.js',
publicPath: "/public/"
},
resolve: {
extensions: [".ts", ".vue", ".js"],
modules: ['node_modules', 'src/main/html', 'src/main/js', 'src/lib/js', 'src/main/ts', 'src/lib/ts'],
alias: {
vue: 'vue/dist/vue.common.js'
}
},
module: {
rules: [
{
test: /\.vue$/,
use: [
{
loader: 'babel-loader',
},
{
loader: 'vue-loader'
}
]
},
{
test: /\.vhtml$/,
loader: 'vue-template-loader'
},
{
test: /\.ts$/,
use: [
{
loader: 'babel-loader',
},
{
loader: 'ts-loader',
options: {
appendTsSuffixTo: [/\.vue$/]
}
}
]
}
]
}
};
config.entry = {
main_js: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./src/main/js/main_js.js"
],
main_js2: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./src/main/js/main_js2.js"
],
main_ts: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./src/main/ts/main_ts.ts"
],
main_ts2: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./src/main/ts/main_ts2.ts"
],
main_router: [
"webpack-dev-server/client?http://localhost:3000",
"webpack/hot/dev-server",
"./src/main/ts/main_router.ts"
]
};
config.plugins = [
new webpack.LoaderOptionsPlugin({
debug: true
}),
new webpack.HotModuleReplacementPlugin()
];
module.exports = config;