-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.main.config.js
42 lines (42 loc) · 1.15 KB
/
webpack.main.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
const TerserPlugin = require("terser-webpack-plugin");
const webpack = require("webpack");
const fs = require("fs");
const util = require("util");
module.exports = {
/**
* This is the main entry point for your application, it's the first file
* that runs in the main process.
*/
entry: "./src/main.js",
// Put your normal webpack config below here
module: {
rules: require("./webpack.rules"),
},
optimization: {
concatenateModules: false,
minimizer: [
new TerserPlugin({
terserOptions: {
keep_classnames: true,
},
}),
],
},
plugins: [
new webpack.ContextReplacementPlugin(/discord.js.+websocket/, /\/.+.js/),
new webpack.ContextReplacementPlugin(
/discord.js.+voice/,
require.resolve("libsodium-wrappers"),
{ "libsodium-wrappers": require.resolve("libsodium-wrappers") }
),
new webpack.ContextReplacementPlugin(
/prism-media/,
require.resolve("@discordjs/opus"),
{ "@discordjs/opus": require.resolve("@discordjs/opus") }
),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/\u001a/,
contextRegExp: /node-pre-gyp/,
}),
],
};