mirror of
https://github.com/alex8088/electron-vite.git
synced 2026-04-29 17:28:15 +08:00
Compare commits
7 Commits
7feae64e7e
...
3df2516566
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3df2516566 | ||
|
|
a9a496dc1a | ||
|
|
201eb213ac | ||
|
|
3d2a979fb1 | ||
|
|
e58369f975 | ||
|
|
e9289f32f7 | ||
|
|
deed6f5891 |
30
package.json
30
package.json
@ -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
1481
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -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: {
|
||||
|
||||
@ -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[] = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user