generated from docrostov/kol-ts-starter
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathwebpack.config.js
51 lines (49 loc) · 1.5 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
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
const path = require("path");
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const webpack = require("webpack"); // does this have a purpose? or can it just get deleted?
const packageData = require("./package.json");
/* eslint-enable @typescript-eslint/no-var-requires */
module.exports = {
entry: {
grimoire: "./src/index.ts",
},
// Turns on tree-shaking and minification in the default Terser minifier
// https://webpack.js.org/plugins/terser-webpack-plugin/
mode: "production",
devtool: false,
output: {
path: path.resolve(__dirname, "KoLmafia", "scripts", packageData.name),
filename: "[name].js",
libraryTarget: "commonjs",
},
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"],
},
module: {
rules: [
{
// Include ts, tsx, js, and jsx files.
test: /\.(ts|js)x?$/,
// exclude: /node_modules/,
loader: "babel-loader",
},
],
},
optimization: {
// Disable compression because it makes debugging more difficult for KolMafia
minimize: false,
},
performance: {
// Disable the warning about assets exceeding the recommended size because this isn't a website script
hints: false,
},
plugins: [],
externals: {
// Necessary to allow kolmafia imports.
kolmafia: "commonjs kolmafia",
// Add any ASH scripts you would like to use here to allow importing. E.g.:
// "canadv.ash": "commonjs canadv.ash",
},
};