Compare commits

...

7 Commits

Author SHA1 Message Date
Beans
3df2516566
Merge deed6f5891e20a26d4653323067576a7ce77a0c3 into a9a496dc1a08bf4486f770bd3f241952be30353d 2026-03-29 23:42:47 +05:00
alex8088
a9a496dc1a fix: Typescript compiler option 'outDir' must be located inside Rollup 'dir' option 2026-03-29 15:22:06 +08:00
alex8088
201eb213ac chore(deps): update cac to v7 2026-03-29 15:20:31 +08:00
alex8088
3d2a979fb1 chore(deps): update globals to v17 2026-03-29 15:05:56 +08:00
alex8088
e58369f975 chore(deps): update eslint and @eslint/js to v10 2026-03-29 15:04:39 +08:00
alex8088
e9289f32f7 chore(deps): update all non-major dependencies 2026-03-29 14:55:56 +08:00
leey0818
deed6f5891 feat(bytecode): support RegExp for chunkAlias option
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:44:03 +09:00
4 changed files with 675 additions and 848 deletions

View File

@ -69,34 +69,34 @@
}
},
"devDependencies": {
"@eslint/js": "^9.37.0",
"@eslint/js": "^10.0.1",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-typescript": "^12.1.4",
"@swc/core": "^1.13.5",
"@rollup/plugin-typescript": "^12.3.0",
"@swc/core": "^1.15.21",
"@types/babel__core": "^7.20.5",
"@types/node": "^22.18.11",
"eslint": "^9.37.0",
"@types/node": "^22.19.15",
"eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"globals": "^16.4.0",
"lint-staged": "^16.2.4",
"prettier": "^3.6.2",
"rollup": "^4.52.4",
"rollup-plugin-dts": "^6.2.3",
"eslint-plugin-prettier": "^5.5.5",
"globals": "^17.4.0",
"lint-staged": "^16.4.0",
"prettier": "^3.8.1",
"rollup": "^4.60.0",
"rollup-plugin-dts": "^6.4.1",
"rollup-plugin-rm": "^1.0.2",
"simple-git-hooks": "^2.13.1",
"tslib": "^2.8.1",
"typescript": "^5.9.3",
"typescript-eslint": "^8.46.1",
"typescript-eslint": "^8.57.2",
"vite": "^7.1.10"
},
"dependencies": {
"@babel/core": "^7.28.4",
"@babel/core": "^7.29.0",
"@babel/plugin-transform-arrow-functions": "^7.27.1",
"cac": "^6.7.14",
"cac": "^7.0.0",
"esbuild": "^0.25.11",
"magic-string": "^0.30.19",
"magic-string": "^0.30.21",
"picocolors": "^1.1.1"
},
"pnpm": {

1481
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@ export default defineConfig([
plugins: [
rm('dist', 'buildStart'),
json(),
ts({ compilerOptions: { rootDir: 'src', declaration: true, declarationDir: 'dist/types' } }),
ts({ compilerOptions: { rootDir: 'src', outDir: 'dist', declaration: true, declarationDir: 'dist/types' } }),
resolve()
],
treeshake: {

View File

@ -143,7 +143,7 @@ const bytecodeModuleLoaderCode = [
const bytecodeChunkExtensionRE = /.(jsc|cjsc)$/
export interface BytecodeOptions {
chunkAlias?: string | string[]
chunkAlias?: string | string[] | RegExp
transformArrowFunctions?: boolean
removeBundleJS?: boolean
protectedStrings?: string[]
@ -160,11 +160,13 @@ export function bytecodePlugin(options: BytecodeOptions = {}): Plugin | null {
}
const { chunkAlias = [], transformArrowFunctions = true, removeBundleJS = true, protectedStrings = [] } = options
const _chunkAlias = Array.isArray(chunkAlias) ? chunkAlias : [chunkAlias]
const _chunkAlias = chunkAlias instanceof RegExp ? chunkAlias : Array.isArray(chunkAlias) ? chunkAlias : [chunkAlias]
const transformAllChunks = _chunkAlias.length === 0
const isBytecodeChunk = (chunkName: string): boolean => {
return transformAllChunks || _chunkAlias.some(alias => alias === chunkName)
if (_chunkAlias instanceof RegExp) {
return _chunkAlias.test(chunkName)
}
return _chunkAlias.length === 0 || _chunkAlias.some(alias => alias === chunkName)
}
const plugins: babel.PluginItem[] = []