akfun 5.2.7 → 5.2.9
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.
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
2
3
|
presets: [
|
|
3
4
|
[
|
|
4
5
|
'@babel/preset-env',
|
|
5
6
|
{
|
|
6
7
|
loose: true,
|
|
7
|
-
modules: false // 是否启用将
|
|
8
|
+
modules: false, // 是否启用将ES6模块语法转换为其他模块类型的功能,当前设置为false,以便webpack进行tree shaking。
|
|
8
9
|
/*
|
|
9
10
|
备注:后续升级babel版本时,再启用此配置
|
|
10
11
|
useBuiltIns: 'usage', // 按需引入 polyfill,替代 @babel/polyfill
|
package/src/rollup/build.js
CHANGED
|
@@ -66,6 +66,10 @@ module.exports = function (config, envConfig, _rollupConfig, _consoleTag) {
|
|
|
66
66
|
}
|
|
67
67
|
if (compress && isArray(curRollupConfig.output)) {
|
|
68
68
|
curRollupConfig.output.map((outputItem) => {
|
|
69
|
+
if (outputItem.notCompressed) {
|
|
70
|
+
// 不压缩代码
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
69
73
|
if (!outputItem.plugins) {
|
|
70
74
|
outputItem.plugins = [terser()];
|
|
71
75
|
} else {
|
|
@@ -74,7 +78,7 @@ module.exports = function (config, envConfig, _rollupConfig, _consoleTag) {
|
|
|
74
78
|
});
|
|
75
79
|
} else if (compress && isObject(curRollupConfig.output)) {
|
|
76
80
|
if (!curRollupConfig.plugins) {
|
|
77
|
-
curRollupConfig.
|
|
81
|
+
curRollupConfig.plugins = [terser()];
|
|
78
82
|
} else {
|
|
79
83
|
curRollupConfig.plugins.push(terser());
|
|
80
84
|
}
|
|
@@ -142,7 +142,8 @@ module.exports = function (curConfig, curEnvConfig) {
|
|
|
142
142
|
output: [
|
|
143
143
|
{
|
|
144
144
|
file: resolveToCurrentDist(`${curFileName}.${buildFormat}.js`, curEnvConfig.outDir),
|
|
145
|
-
format: buildFormat
|
|
145
|
+
format: buildFormat,
|
|
146
|
+
notCompressed: true, // 不压缩代码
|
|
146
147
|
},
|
|
147
148
|
{
|
|
148
149
|
file: resolveToCurrentDist(`${curFileName}.${buildFormat}.min.js`, curEnvConfig.outDir),
|