-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.client.cjs
67 lines (66 loc) · 1.33 KB
/
webpack.client.cjs
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
const path = require("path");
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = function(mode) {
if(mode !== "development") {
mode = "production";
}
return {
mode: mode,
target: "web",
entry: {
game: "./src/client/game/Game.ts",
mapper: "./src/client/tool/mapper/MapperPage.ts",
autotiler: "./src/client/tool/autotiler/AutotilerPage.ts",
tilesetter: "./src/client/tool/tilesetter/TilesetterPage.ts",
tester: "./src/client/tool/test/Tester.ts"
},
output: {
filename: "l4w-[name].js",
library: "L4W_[name]",
path: path.resolve(__dirname, "dist/client")
},
devtool: "source-map",
resolve: {
extensions: [
".ts",
".js",
".vue"
],
alias: {
"vue$": "vue/dist/vue.esm.js"
}
},
module: {
rules: [
{
test: /\.tsx?$/,
exclude: [/node_modules/],
loader: "ts-loader",
options: {
appendTsSuffixTo: [/\.vue$/],
configFile: "src/tsconfig-client.json"
}
},
{
test: /\.vue$/,
loader: "vue-loader"
},
{
test: /\.css$/,
loader: "vue-style-loader"
},
{
test: /\.css$/,
loader: 'css-loader',
options: {
/* https://github.com/vuejs/vue-style-loader/issues/46#issuecomment-670624576 */
esModule: false
}
},
]
},
plugins: [
new VueLoaderPlugin()
]
}
}