polyfill-commons 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,50 @@
1
+ /*
2
+ * @Descripttion:
3
+ * @version:
4
+ * @Author: 金苏
5
+ * @Date: 2021-07-05 17:35:36
6
+ * @LastEditors: 金苏
7
+ * @LastEditTime: 2021-07-06 09:40:24
8
+ */
9
+
10
+ const TerserPlugin = require('terser-webpack-plugin') // 引入压缩插件
11
+
12
+ module.exports = {
13
+ mode: 'none', // 因为默认是production 默认会进行压缩
14
+ entry: {
15
+ "index": "./src/index.js",
16
+ "index.min": "./src/index.js"
17
+ },
18
+ node: {
19
+ // fs: "empty",
20
+ // net: "empty",
21
+ // tls: "empty"
22
+ },
23
+
24
+ module: {
25
+ rules: [{
26
+ test: /.js$/,
27
+ use: {
28
+ loader: 'babel-loader',
29
+ options: {
30
+ presets: ['@babel/preset-env'],
31
+ }
32
+ },
33
+ exclude: /node_modules/ // 排除转换的文件夹
34
+ }]
35
+ },
36
+ output: {
37
+ filename: "[name].js",
38
+ library: "index",
39
+ libraryExport: "default", // 不添加的话引用的时候需要 tools.default
40
+ libraryTarget: "umd", // var this window ...
41
+ },
42
+ optimization: {
43
+ minimize: true,
44
+ minimizer: [
45
+ new TerserPlugin({ // 使用压缩插件
46
+ include: /\.min\.js$/
47
+ })
48
+ ]
49
+ }
50
+ }