forked from jurliyuuri/cerke_online_alpha
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
50 lines (49 loc) · 1.17 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
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const webpack = require("webpack");
module.exports = {
entry: {
entrance: ["./styles/entrance.scss"],
pending: ["./styles/pending.scss"],
vs_cpu_pending: ["./src/vs_cpu_pending.ts"],
random_pending: ["./src/random_pending.ts"],
friend_join_room: ["./src/friend_join_room.ts"],
friend_make_room: ["./src/friend_make_room.ts"],
main: ["./src/main_entry.ts", "./styles/main.scss"],
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "dist"),
},
resolve: {
extensions: [".ts", ".tsx", ".js"],
},
plugins: [
new MiniCssExtractPlugin({
filename: "[name].css",
}),
new webpack.EnvironmentPlugin(["API_ORIGIN"]),
],
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
},
{
test: /\.scss$/,
use: [
{ loader: MiniCssExtractPlugin.loader },
{ loader: "css-loader" },
{ loader: "sass-loader" },
],
},
],
},
devServer: {
static: {
directory: path.join(__dirname, "public"),
},
port: 8000,
},
};