-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
35 lines (34 loc) · 1.04 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
const path = require('path')
const TerserPlugin = require('terser-webpack-plugin')
module.exports = {
mode: 'production', // build for production (minifies the output)
entry: './src/index.ts', // entry point for your library
output: {
path: path.resolve(__dirname, 'dist'), // output directory
filename: 'bundle.min.js', // output file name (minified)
library: 'polybase', // name of the global variable that will contain your library
libraryTarget: 'umd', // format of the bundle (UMD supports both CommonJS and AMD module systems)
},
resolve: {
extensions: ['.ts', '.tsx', '.js'], // resolve TypeScript and JavaScript files
},
module: {
rules: [
{
test: /\.tsx?$/, // apply to TypeScript files
use: 'ts-loader', // use the ts-loader to transpile the TypeScript code
},
],
},
optimization: {
minimizer: [
new TerserPlugin({
terserOptions: {
output: {
comments: false, // remove comments from the output
},
},
}),
],
},
}