InversifyJS icon indicating copy to clipboard operation
InversifyJS copied to clipboard

Whether the inclusion size can be optimized

Open leonwangcn opened this issue 2 years ago • 0 comments

I used rollup for packing and the package was over 50 KB long, There's no other logic in my code

Expected Behavior

The size of the packed inclusion can be reduced to less than 10KB

Current Behavior

The inclusion size is 57KB after packing and compression

Steps to Reproduce (for bugs)

My rollup profile is as follows

/** @type {import('rollup').RollupOptions} */
import resolve from '@rollup/plugin-node-resolve';
import babel from '@rollup/plugin-babel';
import typescript from "@rollup/plugin-typescript";
import terser from "@rollup/plugin-terser";

export default {
	input: 'src/unity/index.ts',
	output: {
		file: 'dist/index.js',
		format: 'esm'
	},
	plugins: [
		resolve(),
		typescript(),
		babel({
			extensions: ['.js', '.ts'],
			presets: ['@babel/preset-env', '@babel/preset-typescript'],
		}),
		terser()
	],
};

Your Environment

"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.5",
"rollup": "^4.3.0",
"tslib": "^2.6.2"

leonwangcn avatar Nov 09 '23 13:11 leonwangcn