Skip to content

Commit 8cf25c1

Browse files
committed
fix: webpack.config.js build output library
1 parent 09b0395 commit 8cf25c1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

webpack.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const webpack = require('webpack');
3-
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
3+
const TerserPlugin = require('terser-webpack-plugin');
44

55
const isProduction = process.env.NODE_ENV === 'production';
66
const mode = isProduction ? 'production' : 'development';
@@ -15,11 +15,11 @@ module.exports = {
1515
},
1616
devtool: 'source-map',
1717
output: {
18-
path: path.resolve(__dirname, 'dist'),
18+
path: path.join(__dirname, 'dist'),
19+
library: libraryName,
20+
libraryTarget: 'umd',
1921
filename: '[name].js',
20-
library: 'Logger',
21-
umdNamedDefine: true,
22-
globalObject: `(typeof self !== 'undefined' ? self : this)`
22+
globalObject: "typeof self !== 'undefined' ? self : this"
2323
},
2424
module: {
2525
rules: [
@@ -37,7 +37,7 @@ module.exports = {
3737
},
3838
optimization: {
3939
minimize: true,
40-
minimizer: [new UglifyJsPlugin({ include: /\.min\.js$/ })]
40+
minimizer: [new TerserPlugin()]
4141
},
4242
plugins: [
4343
new webpack.DefinePlugin({

0 commit comments

Comments
 (0)