@taro-minify-pack/plugin-bundle-analyzer 0.0.5-alpha.5

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/.eslintrc.js ADDED
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ env: {
3
+ node: true,
4
+ es6: true
5
+ },
6
+ extends: [
7
+ 'standard',
8
+ 'plugin:@typescript-eslint/recommended'
9
+ ],
10
+ parser: '@typescript-eslint/parser',
11
+ plugins: ['@typescript-eslint'],
12
+ rules: {
13
+ '@typescript-eslint/no-empty-function': 'off',
14
+ '@typescript-eslint/no-explicit-any': 'off',
15
+ '@typescript-eslint/no-var-requires': 'off',
16
+ '@typescript-eslint/no-non-null-assertion': 'off',
17
+ '@typescript-eslint/ban-ts-comment': 'off',
18
+ '@typescript-eslint/no-unused-vars': 'off',
19
+ 'no-use-before-define': 'off'
20
+ }
21
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 yu.pan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
File without changes
@@ -0,0 +1,5 @@
1
+ import type { IPluginContext } from '@tarojs/service';
2
+ import { BundleAnalyzerOpt } from './types';
3
+ export type { BundleAnalyzerOpt } from './types';
4
+ declare const _default: (ctx: IPluginContext, pluginOpts?: BundleAnalyzerOpt) => void;
5
+ export default _default;
package/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
4
+ exports.default = (ctx, pluginOpts = {}) => {
5
+ ctx.modifyWebpackChain(({ chain }) => {
6
+ const finalOpts = Object.assign(Object.assign({}, pluginOpts), { defaultSizes: 'parsed', analyzerMode: 'server' });
7
+ chain.plugin('analyzer').use(webpack_bundle_analyzer_1.BundleAnalyzerPlugin, [finalOpts]);
8
+ });
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,qEAA8D;AAK9D,kBAAe,CAAC,GAAmB,EAAE,aAAgC,EAAE,EAAE,EAAE;IACzE,GAAG,CAAC,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,gCAAK,UAAU,KAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,GAAkC,CAAA;QACnH,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,8CAAoB,EAAE,CAAC,SAAS,CAAC,CAAC,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ export interface BundleAnalyzerOpt {
2
+ /**
3
+ * Host that will be used in `server` mode to start HTTP server.
4
+ * @default '127.0.0.1'
5
+ */
6
+ analyzerHost?: string | undefined;
7
+ /**
8
+ * Port that will be used in `server` mode to start HTTP server.
9
+ * @default 8888
10
+ */
11
+ analyzerPort?: number | 'auto' | undefined;
12
+ /**
13
+ * Automatically open report in default browser.
14
+ * @default true
15
+ */
16
+ openAnalyzer?: boolean | undefined;
17
+ }
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@taro-minify-pack/plugin-bundle-analyzer",
3
+ "version": "0.0.5-alpha.5",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "homepage": "https://github.com/panyu97py/taro-minify-pack",
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/panyu97py/taro-minify-pack.git"
14
+ },
15
+ "author": "yu.pan",
16
+ "license": "MIT",
17
+ "dependencies": {
18
+ "webpack-bundle-analyzer": "^5.1.1"
19
+ },
20
+ "devDependencies": {
21
+ "@tarojs/service": "^4.0.8",
22
+ "@types/webpack-bundle-analyzer": "^4.7.0",
23
+ "@typescript-eslint/eslint-plugin": "^8.26.1",
24
+ "@typescript-eslint/parser": "^8.26.1",
25
+ "eslint": "^8.19.0",
26
+ "eslint-config-standard": "^17.0.0",
27
+ "eslint-plugin-import": "^2.26.0",
28
+ "eslint-plugin-n": "^15.2.3",
29
+ "eslint-plugin-promise": "^6.0.0",
30
+ "typescript": "^5.8.2"
31
+ },
32
+ "scripts": {
33
+ "build": "tsc"
34
+ }
35
+ }
package/src/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ import type { IPluginContext } from '@tarojs/service'
2
+ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
3
+ import { BundleAnalyzerOpt } from './types'
4
+
5
+ export type { BundleAnalyzerOpt } from './types'
6
+
7
+ export default (ctx: IPluginContext, pluginOpts: BundleAnalyzerOpt = {}) => {
8
+ ctx.modifyWebpackChain(({ chain }) => {
9
+ const finalOpts = { ...pluginOpts, defaultSizes: 'parsed', analyzerMode: 'server' } as BundleAnalyzerPlugin.Options
10
+ chain.plugin('analyzer').use(BundleAnalyzerPlugin, [finalOpts])
11
+ })
12
+ }
package/src/types.ts ADDED
@@ -0,0 +1,19 @@
1
+ export interface BundleAnalyzerOpt {
2
+ /**
3
+ * Host that will be used in `server` mode to start HTTP server.
4
+ * @default '127.0.0.1'
5
+ */
6
+ analyzerHost?: string | undefined;
7
+
8
+ /**
9
+ * Port that will be used in `server` mode to start HTTP server.
10
+ * @default 8888
11
+ */
12
+ analyzerPort?: number | 'auto' | undefined;
13
+
14
+ /**
15
+ * Automatically open report in default browser.
16
+ * @default true
17
+ */
18
+ openAnalyzer?: boolean | undefined;
19
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2015",
4
+ "module": "commonjs",
5
+ "strict": true,
6
+ "sourceMap": true,
7
+ "declaration": true,
8
+ "esModuleInterop": true,
9
+ "moduleResolution": "node",
10
+ // 声明文件生成到的文件目录
11
+ "outDir": "./dist/",
12
+ "skipLibCheck": true,
13
+ /* Skip type checking of declaration files. */
14
+ "forceConsistentCasingInFileNames": true,
15
+ "jsx": "react",
16
+ "lib": ["esnext", "dom"],
17
+ "types": ["@types/webpack-bundle-analyzer"]
18
+ },
19
+ "include": ["src"]
20
+ }