aboutsummaryrefslogtreecommitdiffstats
path: root/webpack.config.base.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.base.js')
-rw-r--r--webpack.config.base.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/webpack.config.base.js b/webpack.config.base.js
new file mode 100644
index 000000000..342c8c455
--- /dev/null
+++ b/webpack.config.base.js
@@ -0,0 +1,24 @@
1const path = require('path');
2const TerserPlugin = require('terser-webpack-plugin');
3
4const IS_DEV = process.env.NODE_ENV === 'development';
5
6module.exports = dir => ({
7 context: dir,
8 entry: path.join(dir, '/src/index.ts'),
9 module: {
10 rules: [{
11 test: /\.tsx?$/,
12 loader: 'ts-loader',
13 exclude: /node_modules/,
14 }],
15 },
16 resolve: {
17 extensions: ['.tsx', '.ts', '.js'],
18 },
19 devtool: 'inline-source-map',
20 mode: IS_DEV ? 'development' : 'production',
21 optimization: {
22 minimizer: !IS_DEV ? [new TerserPlugin()] : null,
23 },
24});