@taro-minify-pack/preset 0.1.4-alpha.0 → 0.1.4-alpha.3
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/dist/index.d.ts +5 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +7 -5
- package/src/index.ts +9 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,14 +2,17 @@ import type { RemoteAssetPluginOpt } from '@taro-minify-pack/plugin-remote-asset
|
|
|
2
2
|
import type { AsyncPackOpts } from '@taro-minify-pack/plugin-async-pack';
|
|
3
3
|
import type { CoverBrowsersListOpt } from '@taro-minify-pack/plugin-cover-browserslist';
|
|
4
4
|
import type { BundleAnalyzerOpt } from '@taro-minify-pack/plugin-bundle-analyzer';
|
|
5
|
-
|
|
5
|
+
import type { BundleStatsOpt } from '@taro-minify-pack/plugin-bundle-stats';
|
|
6
|
+
export * from '@taro-minify-pack/helper';
|
|
7
|
+
export * from '@taro-minify-pack/plugin-async-pack';
|
|
6
8
|
interface Opt {
|
|
7
9
|
asyncPack?: AsyncPackOpts | boolean;
|
|
10
|
+
bundleStats?: BundleStatsOpt | boolean;
|
|
8
11
|
bundleAnalyzer?: BundleAnalyzerOpt | boolean;
|
|
9
12
|
coverBrowsersList?: CoverBrowsersListOpt;
|
|
10
13
|
remoteAssets?: RemoteAssetPluginOpt;
|
|
11
14
|
}
|
|
12
15
|
declare const _default: (_: any, opt: Opt) => {
|
|
13
|
-
plugins: (string | (string | RemoteAssetPluginOpt)[] | (string | CoverBrowsersListOpt)[] | (string | AsyncPackOpts | undefined)[] | (string | BundleAnalyzerOpt | undefined)[])[];
|
|
16
|
+
plugins: (string | (string | RemoteAssetPluginOpt)[] | (string | CoverBrowsersListOpt)[] | (string | AsyncPackOpts | undefined)[] | (string | BundleAnalyzerOpt | undefined)[] | (string | BundleStatsOpt | undefined)[])[];
|
|
14
17
|
};
|
|
15
18
|
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("@taro-minify-pack/
|
|
17
|
+
__exportStar(require("@taro-minify-pack/helper"), exports);
|
|
18
|
+
__exportStar(require("@taro-minify-pack/plugin-async-pack"), exports);
|
|
18
19
|
exports.default = (_, opt) => {
|
|
19
|
-
const { remoteAssets, asyncPack, coverBrowsersList, bundleAnalyzer } = opt;
|
|
20
|
+
const { remoteAssets, asyncPack, coverBrowsersList, bundleAnalyzer, bundleStats } = opt;
|
|
20
21
|
const plugins = [];
|
|
21
22
|
// 远程静态资源插件
|
|
22
23
|
if (remoteAssets)
|
|
@@ -34,6 +35,11 @@ exports.default = (_, opt) => {
|
|
|
34
35
|
plugins.push(require.resolve('@taro-minify-pack/plugin-bundle-analyzer'));
|
|
35
36
|
if (Boolean(bundleAnalyzer) && typeof bundleAnalyzer !== 'boolean')
|
|
36
37
|
plugins.push([require.resolve('@taro-minify-pack/plugin-bundle-analyzer'), bundleAnalyzer]);
|
|
38
|
+
// 包体积分析插件
|
|
39
|
+
if (Boolean(bundleStats) && typeof bundleStats === 'boolean')
|
|
40
|
+
plugins.push(require.resolve('@taro-minify-pack/plugin-bundle-analyzer'));
|
|
41
|
+
if (Boolean(bundleStats) && typeof bundleStats !== 'boolean')
|
|
42
|
+
plugins.push([require.resolve('@taro-minify-pack/plugin-bundle-analyzer'), bundleStats]);
|
|
37
43
|
return { plugins };
|
|
38
44
|
};
|
|
39
45
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version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AAU;IACV,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,OAAO,WAAW,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC,CAAA;IACvI,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,OAAO,WAAW,KAAK,SAAS;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,0CAA0C,CAAC,EAAE,WAAW,CAAC,CAAC,CAAA;IAEtJ,OAAO,EAAE,OAAO,EAAE,CAAA;AACpB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taro-minify-pack/preset",
|
|
3
|
-
"version": "0.1.4-alpha.
|
|
3
|
+
"version": "0.1.4-alpha.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
"author": "yu.pan",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@taro-minify-pack/plugin-
|
|
19
|
-
"@taro-minify-pack/plugin-
|
|
20
|
-
"@taro-minify-pack/
|
|
21
|
-
"@taro-minify-pack/plugin-
|
|
18
|
+
"@taro-minify-pack/plugin-bundle-analyzer": "0.1.4-alpha.3",
|
|
19
|
+
"@taro-minify-pack/plugin-async-pack": "0.1.4-alpha.3",
|
|
20
|
+
"@taro-minify-pack/helper": "0.1.4-alpha.3",
|
|
21
|
+
"@taro-minify-pack/plugin-cover-browserslist": "0.1.4-alpha.3",
|
|
22
|
+
"@taro-minify-pack/plugin-bundle-stats": "0.1.4-alpha.3",
|
|
23
|
+
"@taro-minify-pack/plugin-remote-assets": "0.1.4-alpha.3"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@types/node": "^18.19.130",
|
package/src/index.ts
CHANGED
|
@@ -2,18 +2,21 @@ import type { RemoteAssetPluginOpt } from '@taro-minify-pack/plugin-remote-asset
|
|
|
2
2
|
import type { AsyncPackOpts } from '@taro-minify-pack/plugin-async-pack'
|
|
3
3
|
import type{ CoverBrowsersListOpt } from '@taro-minify-pack/plugin-cover-browserslist'
|
|
4
4
|
import type { BundleAnalyzerOpt } from '@taro-minify-pack/plugin-bundle-analyzer'
|
|
5
|
+
import type { BundleStatsOpt } from '@taro-minify-pack/plugin-bundle-stats'
|
|
5
6
|
|
|
6
|
-
export * from '@taro-minify-pack/
|
|
7
|
+
export * from '@taro-minify-pack/helper'
|
|
8
|
+
export * from '@taro-minify-pack/plugin-async-pack'
|
|
7
9
|
|
|
8
10
|
interface Opt {
|
|
9
11
|
asyncPack?: AsyncPackOpts | boolean
|
|
12
|
+
bundleStats?:BundleStatsOpt | boolean
|
|
10
13
|
bundleAnalyzer?:BundleAnalyzerOpt | boolean
|
|
11
14
|
coverBrowsersList?: CoverBrowsersListOpt
|
|
12
15
|
remoteAssets?: RemoteAssetPluginOpt
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
export default (_: any, opt: Opt) => {
|
|
16
|
-
const { remoteAssets, asyncPack, coverBrowsersList, bundleAnalyzer } = opt
|
|
19
|
+
const { remoteAssets, asyncPack, coverBrowsersList, bundleAnalyzer, bundleStats } = opt
|
|
17
20
|
const plugins = []
|
|
18
21
|
|
|
19
22
|
// 远程静态资源插件
|
|
@@ -30,5 +33,9 @@ export default (_: any, opt: Opt) => {
|
|
|
30
33
|
if (Boolean(bundleAnalyzer) && typeof bundleAnalyzer === 'boolean') plugins.push(require.resolve('@taro-minify-pack/plugin-bundle-analyzer'))
|
|
31
34
|
if (Boolean(bundleAnalyzer) && typeof bundleAnalyzer !== 'boolean') plugins.push([require.resolve('@taro-minify-pack/plugin-bundle-analyzer'), bundleAnalyzer])
|
|
32
35
|
|
|
36
|
+
// 包体积分析插件
|
|
37
|
+
if (Boolean(bundleStats) && typeof bundleStats === 'boolean') plugins.push(require.resolve('@taro-minify-pack/plugin-bundle-analyzer'))
|
|
38
|
+
if (Boolean(bundleStats) && typeof bundleStats !== 'boolean') plugins.push([require.resolve('@taro-minify-pack/plugin-bundle-analyzer'), bundleStats])
|
|
39
|
+
|
|
33
40
|
return { plugins }
|
|
34
41
|
}
|