forked from ManimCommunity/manim_editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
55 lines (54 loc) · 1.89 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
const path = require("path");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = (env) => {
return {
mode: env["production"] ? "production" : "development",
devtool: env["production"] ? false : "eval-cheap-module-source-map",
plugins: [new MiniCssExtractPlugin()],
entry: {
base: "./web_src/ts/base.ts",
edit_project: "./web_src/ts/edit_project.ts",
scene_selection: "./web_src/ts/scene_selection.ts",
},
resolve: {
extensions: [".ts", ".js"],
},
output: {
filename: "[name].js",
path: path.resolve(__dirname, "./manim_editor/app/static/webpack"),
},
module: {
rules: [
// SCSS
{
// inject CSS to page
test: /\.(scss)$/,
use: [
{
// bundle in separate CSS file
// <- loading with JavaScript takes a few millisections every time the page reloads
loader: MiniCssExtractPlugin.loader,
},
{
// translate CSS into CommonJS modules
loader: "css-loader",
},
{
// compile SCSS to Css
loader: "sass-loader",
}
]
},
// TypeScript
{
test: /\.ts$/,
use: "ts-loader",
include: [
path.resolve(__dirname, "./web_src/ts"),
path.resolve(__dirname, "./web_src/scss"),
],
}
]
}
};
};