forked from ProdigyAPI/ProdigyXHack
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathwebpack.config.js
More file actions
62 lines (59 loc) · 1.47 KB
/
webpack.config.js
File metadata and controls
62 lines (59 loc) · 1.47 KB
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
const path = require("path")
const { sync } = require("glob")
const webpack = require("webpack")
const TerserPlugin = require("terser-webpack-plugin")
const outputFolder = path.resolve(__dirname, "dist")
const outputFile = "bundle.js"
module.exports = {
mode: "production",
entry: [
...sync(path.join(__dirname, "./src/hacks/**/*.ts{,x}").replace(/\\/g, "/")),
"./src/index.tsx"
],
output: {
filename: outputFile,
path: outputFolder
},
plugins: [
new webpack.ProgressPlugin(),
new webpack.DefinePlugin({
"process.env.EXTENSION": false
})
],
module: {
rules: [
{
test: /\.(ts|tsx)$/i,
loader: "ts-loader"
},
{
test: /\.s[ac]ss$/i,
use: [
"style-loader",
"css-loader",
"postcss-loader",
"sass-loader"
]
},
{
test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i,
type: "asset"
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
alias: {
react: "preact/compat",
"react-dom": "preact/compat"
}
},
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
extractComments: false
})
]
}
}