-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
53 lines (50 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
52
53
/*
* Copyright © 2020. TIBCO Software Inc.
* This file is subject to the license terms contained
* in the license file that is distributed with this file.
*/
const path = require("path");
const webpack = require("webpack");
const CopyPlugin = require("copy-webpack-plugin");
const keysTransformer = require("ts-transformer-keys/transformer").default;
module.exports = {
mode: "development",
entry: "./src/index.ts",
output: {
path: path.resolve(__dirname, "dist"),
filename: "bundle.js"
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: "ts-loader",
exclude: /node_modules/,
options: {
// make sure not to set `transpileOnly: true` here, otherwise it will not work
getCustomTransformers: (program) => ({
before: [keysTransformer(program)]
})
}
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
resolve: {
extensions: [".tsx", ".ts", ".js"],
//fallback: { fs: false, buffer: require.resolve("buffer"), "util": false, tty: false }
},
plugins: [
new CopyPlugin({ patterns: [{ from: "static" }] }),
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"]
})
],
performance: {
maxEntrypointSize: 800000,
maxAssetSize: 800000
}
};