-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
36 lines (35 loc) · 993 Bytes
/
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
const path = require("path");
const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
module.exports = {
mode: "production",
context: path.resolve(__dirname, "src"),
entry: {
"fullscript-js": "./index.ts",
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "[name].umd.min.js",
libraryTarget: "umd",
},
resolve: {
extensions: [".ts", ".mjs", ".js", ".json"],
},
module: {
rules: [
{
test: /\.ts$/,
loader: "babel-loader",
},
],
},
optimization: {
sideEffects: true, //Note that any imported file is subject to tree shaking. This means if you use something like css-loader in your project and import a CSS file, it needs to be added to the side effect list so it will not be unintentionally dropped in production mode:
},
plugins: [
new BundleAnalyzerPlugin({
analyzerMode: "static",
openAnalyzer: false,
reportFilename: "../bundle_sizes.html",
}),
],
};