├── src ├── types.ts ├── utils.ts ├── generate-export-v0.9.0.txt ├── generate-export.ts ├── generate-import.ts ├── analyze.ts ├── dynamic-require.ts ├── generate-import-v0.5.3.txt └── index.ts ├── commonjs.jpg ├── test ├── fixtures │ ├── src │ │ ├── module-exports │ │ │ ├── hello.cjs │ │ │ └── world.cjs │ │ ├── cjs.js │ │ ├── dynamic.tsx │ │ ├── main.ts │ │ └── exports.js │ ├── v0.4.0 │ │ ├── input.js │ │ └── output.js │ ├── index.html │ ├── v0.4.4 │ │ ├── input.js │ │ └── output.js │ ├── __snapshots__ │ │ ├── main.ts │ │ ├── module-exports │ │ │ ├── hello.cjs │ │ │ └── world.cjs │ │ ├── cjs.js │ │ ├── dynamic.tsx │ │ └── exports.js │ ├── v0.3.0 │ │ ├── input.js │ │ └── output.js │ ├── v0.3.2 │ │ ├── input.js │ │ └── output.js │ ├── vite.config.ts │ └── v0.4.7 │ │ ├── input.js │ │ └── output.js └── serve.test.ts ├── tsconfig.json ├── LICENSE ├── package.json ├── vite.config.ts ├── .gitignore ├── README.zh-CN.md ├── README.md ├── CHANGELOG.md ├── commonjs.zh-CN.md └── yarn.lock /src/types.ts: -------------------------------------------------------------------------------- 1 | type AcornNode = import('acorn').Node & Record -------------------------------------------------------------------------------- /commonjs.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vite-plugin/vite-plugin-commonjs/HEAD/commonjs.jpg -------------------------------------------------------------------------------- /test/fixtures/src/module-exports/hello.cjs: -------------------------------------------------------------------------------- 1 | 2 | module.exports = 'module-exports/hello.cjs' 3 | -------------------------------------------------------------------------------- /test/fixtures/src/module-exports/world.cjs: -------------------------------------------------------------------------------- 1 | 2 | module.exports = 'module-exports/world.cjs' 3 | -------------------------------------------------------------------------------- /test/fixtures/src/cjs.js: -------------------------------------------------------------------------------- 1 | if (typeof exports !== 'undefined') { 2 | if (typeof module !== 'undefined' && module.exports) { 3 | exports = module.exports = { 4 | cjs: 'cjs', 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.0/input.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function fn() { }; 3 | 4 | exports.foo = 'foo'; 5 | 6 | function fn2() { 7 | exports.bar = exports.foo; 8 | } 9 | 10 | const obj = { foo: 'foo' }; 11 | 12 | exports.obj = obj; 13 | -------------------------------------------------------------------------------- /test/fixtures/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | vite-plugin-commonjs 5 | 6 | 7 |
8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/fixtures/src/dynamic.tsx: -------------------------------------------------------------------------------- 1 | 2 | function load(name: string) { 3 | const mod = require(`@/module-exports/${name}`) 4 | console.log(mod) 5 | return mod 6 | } 7 | 8 | export const hello = `[dynamic.tsx] ${load('hello.cjs').default}` 9 | export const world = `[dynamic.tsx] ${load('world.cjs').default}` 10 | -------------------------------------------------------------------------------- /test/fixtures/src/main.ts: -------------------------------------------------------------------------------- 1 | const { msg: message } = require('./exports') 2 | 3 | // import { cjs } from './cjs' 4 | import cjs from './cjs' 5 | 6 | document.querySelector('#app')!.innerHTML = ` 7 |
 8 |     ${message}
 9 |   
10 |
11 |
12 |     ${cjs.cjs}
13 |   
14 | ` 15 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.4/input.js: -------------------------------------------------------------------------------- 1 | 2 | module.exports = function fn() { }; 3 | module.exports = function fn() { }; 4 | 5 | exports.foo = 'foo'; 6 | exports.foo = 'foo'; 7 | 8 | function fn2() { 9 | exports.bar = exports.foo; 10 | } 11 | 12 | const obj = { foo: 'foo' }; 13 | 14 | exports.obj = obj; 15 | exports.obj = obj; 16 | -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/main.ts: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] import-hoist-S */ import * as __CJS__import__0__ from "./exports"; /* [vite-plugin-commonjs] import-hoist-E */const { msg: message } = (__CJS__import__0__.default || __CJS__import__0__); 2 | import cjs from "./cjs"; 3 | document.querySelector("#app").innerHTML = ` 4 |
 5 |     ${message}
 6 |   
7 |
8 |
 9 |     ${cjs.cjs}
10 |   
11 | `; 12 | -------------------------------------------------------------------------------- /test/fixtures/src/exports.js: -------------------------------------------------------------------------------- 1 | 2 | const { hello, world } = require('./dynamic') 3 | 4 | // ❌ `exports` exported members are dynamic. 5 | // import { cjs } from './cjs' 6 | // ✅ 7 | import cjs from './cjs' 8 | 9 | exports.msg = ` 10 | [foo.js] 11 | 12 | const { hello, world } = require('./dynamic') 13 | 14 | hello: ${hello} 15 | world: ${world} 16 | 17 |
18 | [cjs.js] 19 | 20 | import cjs from './cjs' 21 | 22 | cjs: ${JSON.stringify(cjs)} 23 | ` 24 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2022", 4 | "module": "ESNext", 5 | "esModuleInterop": true, 6 | "moduleResolution": "Node", 7 | "resolveJsonModule": true, 8 | "strict": true, 9 | "allowJs": true, 10 | "declaration": true, 11 | "skipLibCheck": true, 12 | "allowSyntheticDefaultImports": true, 13 | "baseUrl": ".", 14 | "outDir": "types", 15 | "emitDeclarationOnly": true 16 | }, 17 | "include": ["src"] 18 | } 19 | -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/module-exports/hello.cjs: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] export-runtime-S */ var module = { exports: {} }; var exports = module.exports; /* [vite-plugin-commonjs] export-runtime-E */ 2 | module.exports = 'module-exports/hello.cjs' 3 | /* [vite-plugin-commonjs] export-statement-S */ 4 | const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports; 5 | export { 6 | __CJS__export_default__ as default, 7 | } 8 | /* [vite-plugin-commonjs] export-statement-E */ -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/module-exports/world.cjs: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] export-runtime-S */ var module = { exports: {} }; var exports = module.exports; /* [vite-plugin-commonjs] export-runtime-E */ 2 | module.exports = 'module-exports/world.cjs' 3 | /* [vite-plugin-commonjs] export-statement-S */ 4 | const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports; 5 | export { 6 | __CJS__export_default__ as default, 7 | } 8 | /* [vite-plugin-commonjs] export-statement-E */ -------------------------------------------------------------------------------- /src/utils.ts: -------------------------------------------------------------------------------- 1 | import { builtinModules } from 'node:module' 2 | import { multilineCommentsRE, singlelineCommentsRE } from 'vite-plugin-utils/constant' 3 | 4 | export const builtins = [ 5 | ...builtinModules.map(m => !m.startsWith('_')), 6 | ...builtinModules.map(m => !m.startsWith('_')).map(m => `node:${m}`) 7 | ] 8 | 9 | export function isCommonjs(code: string) { 10 | // Avoid matching the content of the comment 11 | code = code 12 | .replace(multilineCommentsRE, '') 13 | .replace(singlelineCommentsRE, '') 14 | return /\b(?:require|module|exports)\b/.test(code) 15 | } 16 | -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/cjs.js: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] export-runtime-S */ var module = { exports: {} }; var exports = module.exports; /* [vite-plugin-commonjs] export-runtime-E */if (typeof exports !== 'undefined') { 2 | if (typeof module !== 'undefined' && module.exports) { 3 | exports = module.exports = { 4 | cjs: 'cjs', 5 | } 6 | } 7 | } 8 | /* [vite-plugin-commonjs] export-statement-S */ 9 | const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports; 10 | export { 11 | __CJS__export_default__ as default, 12 | } 13 | /* [vite-plugin-commonjs] export-statement-E */ -------------------------------------------------------------------------------- /test/fixtures/v0.3.0/input.js: -------------------------------------------------------------------------------- 1 | require('path'); 2 | require('path').resolve; 3 | 4 | try { 5 | require('uninstalled-external-module'); 6 | } catch (ignored) { 7 | /* ignore */ 8 | } 9 | 10 | const fs = require('fs'); 11 | const readFile = require('fs').readFile; 12 | const { stat, cp: cpAlias } = require('fs'); 13 | 14 | const modules = [ 15 | require('@angular/core'), 16 | require('@angular/core').default.value, 17 | ]; 18 | 19 | const json = { 20 | a: require('./input'), 21 | b: require('./b').b(), 22 | c: [ 23 | require('./c'), 24 | ], 25 | }; 26 | 27 | const routes = [ 28 | { 29 | name: 'Home', 30 | component: require('./Home.vue'), 31 | }, 32 | ]; 33 | 34 | function load(path) { 35 | require(path); 36 | } 37 | 38 | const load2 = path => require(path); 39 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.0/output.js: -------------------------------------------------------------------------------- 1 | /* export-runtime-S */ const module = { exports: {} }; const exports = module.exports; /* export-runtime-E */ 2 | const __CJS__export_default__ = module.exports = function fn() { }; 3 | 4 | exports.foo = 'foo'; 5 | 6 | function fn2() { 7 | exports.bar = exports.foo; 8 | } 9 | 10 | const obj = { foo: 'foo' }; 11 | 12 | exports.obj = obj; 13 | 14 | // --------- vite-plugin-commonjs --------- 15 | export { __CJS__export_default__ as default } 16 | 17 | const __CJS__export_foo__ = (module.exports == null ? {} : module.exports).foo; 18 | const __CJS__export_bar__ = (module.exports == null ? {} : module.exports).bar; 19 | const __CJS__export_obj__ = (module.exports == null ? {} : module.exports).obj; 20 | export { 21 | __CJS__export_foo__ as foo, 22 | __CJS__export_bar__ as bar, 23 | __CJS__export_obj__ as obj 24 | } 25 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.4/output.js: -------------------------------------------------------------------------------- 1 | /* export-runtime-S */ const module = { exports: {} }; const exports = module.exports; /* export-runtime-E */ 2 | module.exports = function fn() { }; 3 | const __CJS__export_default__ = module.exports = function fn() { }; 4 | 5 | exports.foo = 'foo'; 6 | exports.foo = 'foo'; 7 | 8 | function fn2() { 9 | exports.bar = exports.foo; 10 | } 11 | 12 | const obj = { foo: 'foo' }; 13 | 14 | exports.obj = obj; 15 | exports.obj = obj; 16 | 17 | // --------- vite-plugin-commonjs --------- 18 | export { __CJS__export_default__ as default } 19 | 20 | const __CJS__export_foo__ = (module.exports == null ? {} : module.exports).foo; 21 | const __CJS__export_bar__ = (module.exports == null ? {} : module.exports).bar; 22 | const __CJS__export_obj__ = (module.exports == null ? {} : module.exports).obj; 23 | export { 24 | __CJS__export_foo__ as foo, 25 | __CJS__export_bar__ as bar, 26 | __CJS__export_obj__ as obj 27 | } 28 | -------------------------------------------------------------------------------- /test/fixtures/v0.3.2/input.js: -------------------------------------------------------------------------------- 1 | require('path'); 2 | require('path').resolve; 3 | 4 | try { 5 | // TODO 6 | require('uninstalled-external-module'); 7 | } catch (ignored) { 8 | /* ignore */ 9 | } 10 | 11 | const fs = require('fs'); 12 | const readFile = require('fs').readFile; 13 | const { stat, cp: cpAlias } = require('fs'); 14 | 15 | const modules = [ 16 | require('@angular/core'), 17 | require('@angular/core').default.value, 18 | ]; 19 | 20 | const json = { 21 | a: require('./input'), 22 | b: require('./b').b(), 23 | c: [ 24 | require('./c'), 25 | ], 26 | }; 27 | 28 | const routes = [ 29 | { 30 | name: 'Home', 31 | component: require('./Home.vue'), 32 | }, 33 | ]; 34 | 35 | function load(path) { 36 | // TODO 37 | require(path); 38 | } 39 | 40 | // TODO 41 | const load2 = path => require(path); 42 | 43 | // ---- v0.3.2 ---- 44 | 45 | if (require('./if-id').func()) { 46 | require('./if-id').foo.bar 47 | } 48 | -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/dynamic.tsx: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] import-require2import-S */ import * as __dynamic_require2import__1__0 from './module-exports/hello.cjs'; import * as __dynamic_require2import__1__1 from './module-exports/world.cjs'; /* [vite-plugin-commonjs] import-require2import-E */function load(name) { 2 | const mod = __matchRequireRuntime0__(`@/module-exports/${name}`); 3 | console.log(mod); 4 | return mod; 5 | } 6 | export const hello = `[dynamic.tsx] ${load("hello.cjs").default}`; 7 | export const world = `[dynamic.tsx] ${load("world.cjs").default}`; 8 | 9 | function __matchRequireRuntime0__(path) { 10 | switch(path) { 11 | case '@/module-exports/hello': 12 | case '@/module-exports/hello.cjs': 13 | return __dynamic_require2import__1__0; 14 | case '@/module-exports/world': 15 | case '@/module-exports/world.cjs': 16 | return __dynamic_require2import__1__1; 17 | default: throw new Error("Cann't found module: " + path); 18 | } 19 | } -------------------------------------------------------------------------------- /test/fixtures/vite.config.ts: -------------------------------------------------------------------------------- 1 | import path from 'path' 2 | import fs from 'fs' 3 | import { defineConfig } from 'vite' 4 | import commonjs from '../..' 5 | 6 | export default defineConfig({ 7 | root: __dirname, 8 | plugins: [ 9 | commonjs(), 10 | { 11 | name: 'vite-plugin-commonjs-test', 12 | transform(code, id) { 13 | if (/\/src\//.test(id)) { 14 | // write transformed code to dist/ 15 | const filename = id.replace('src', 'dist') 16 | const dirname = path.dirname(filename) 17 | if (!fs.existsSync(dirname)) fs.mkdirSync(dirname) 18 | fs.writeFileSync(filename, code) 19 | } 20 | }, 21 | }, 22 | ], 23 | resolve: { 24 | alias: { 25 | '@': path.join(__dirname, 'src'), 26 | }, 27 | extensions: [ 28 | '.cjs', 29 | '.mjs', 30 | '.js', 31 | '.mts', 32 | '.ts', 33 | '.jsx', 34 | '.tsx', 35 | '.json', 36 | ], 37 | }, 38 | }) 39 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.7/input.js: -------------------------------------------------------------------------------- 1 | 2 | require('foo'); 3 | require('foo').bar; 4 | require('foo').bar(); 5 | 6 | const foo = require('foo'); 7 | const fooDefault = require('foo').default; 8 | const { f1, f2: f22, f3 } = require('foo').default; 9 | const { b1, b2: b22, b3 } = require('foo').bar; 10 | const bar = require('foo').bar; 11 | const baz = require('foo').bar.baz; 12 | const { z1, z2: z22 } = require('foo').baz(); 13 | 14 | const foo_require = require('foo'); 15 | exports.foo_require = foo_require; 16 | exports.foo = require('foo'); 17 | exports.bar = require('foo').bar; 18 | exports.bar = require('foo').bar.baz; 19 | module.exports = require('foo').bar.baz; 20 | exports.default = module.exports; 21 | 22 | const routes = [{ 23 | path: '/', 24 | component: require('@/views/home.vue'), 25 | }]; 26 | 27 | if (require('foo').bar) { 28 | const result = require('foo').bar.baz(); 29 | if (result) { 30 | module.exports = require('foo').bar.baz(); 31 | } 32 | } 33 | 34 | function fn1(path) { 35 | require(path); 36 | } -------------------------------------------------------------------------------- /test/fixtures/v0.3.0/output.js: -------------------------------------------------------------------------------- 1 | /* Declaration-promotion-S */ import * as __CJS_import__5__ from '@angular/core'; import * as __CJS_import__6__ from '@angular/core'; import * as __CJS_import__7__ from './input'; import * as __CJS_import__8__ from './b'; import * as __CJS_import__9__ from './c'; import * as __CJS_import__10__ from './Home.vue'; /* Declaration-promotion-E */import 'path'; 2 | import 'path'; 3 | 4 | try { 5 | require('uninstalled-external-module'); 6 | } catch (ignored) { 7 | /* ignore */ 8 | } 9 | 10 | import * as fs from 'fs'; 11 | import { readFile } from 'fs'; 12 | import { stat, cp as cpAlias } from 'fs'; 13 | 14 | const modules = [ 15 | __CJS_import__5__, 16 | __CJS_import__6__.default.value, 17 | ]; 18 | 19 | const json = { 20 | a: __CJS_import__7__, 21 | b: __CJS_import__8__.b(), 22 | c: [ 23 | __CJS_import__9__, 24 | ], 25 | }; 26 | 27 | const routes = [ 28 | { 29 | name: 'Home', 30 | component: __CJS_import__10__, 31 | }, 32 | ]; 33 | 34 | function load(path) { 35 | require(path); 36 | } 37 | 38 | const load2 = path => require(path); 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 vite-plugin 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. 22 | -------------------------------------------------------------------------------- /test/fixtures/__snapshots__/exports.js: -------------------------------------------------------------------------------- 1 | /* [vite-plugin-commonjs] export-runtime-S */ var module = { exports: {} }; var exports = module.exports; /* [vite-plugin-commonjs] export-runtime-E *//* [vite-plugin-commonjs] import-hoist-S */ import * as __CJS__import__0__ from "./dynamic"; /* [vite-plugin-commonjs] import-hoist-E */ 2 | const { hello, world } = (__CJS__import__0__.default || __CJS__import__0__) 3 | 4 | // ❌ `exports` exported members are dynamic. 5 | // import { cjs } from './cjs' 6 | // ✅ 7 | import cjs from './cjs' 8 | 9 | exports.msg = ` 10 | [foo.js] 11 | 12 | const { hello, world } = require('./dynamic') 13 | 14 | hello: ${hello} 15 | world: ${world} 16 | 17 |
18 | [cjs.js] 19 | 20 | import cjs from './cjs' 21 | 22 | cjs: ${JSON.stringify(cjs)} 23 | ` 24 | /* [vite-plugin-commonjs] export-statement-S */ 25 | const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports; 26 | const __CJS__export_msg__ = (module.exports == null ? {} : module.exports).msg; 27 | export { 28 | __CJS__export_default__ as default, 29 | __CJS__export_msg__ as msg, 30 | } 31 | /* [vite-plugin-commonjs] export-statement-E */ -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vite-plugin-commonjs", 3 | "version": "0.10.4", 4 | "description": "A pure JavaScript implementation of CommonJs", 5 | "main": "./dist/index.js", 6 | "types": "./dist/index.d.ts", 7 | "exports": { 8 | ".": { 9 | "types": "./dist/index.d.ts", 10 | "import": "./dist/index.mjs", 11 | "require": "./dist/index.js" 12 | }, 13 | "./*": "./*" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/vite-plugin/vite-plugin-commonjs.git" 18 | }, 19 | "author": "草鞋没号 <308487730@qq.com>", 20 | "license": "MIT", 21 | "scripts": { 22 | "dev": "vite build --watch", 23 | "build": "vite build", 24 | "test": "vitest run", 25 | "types": "tsc", 26 | "prepublishOnly": "npm run build && npm run test" 27 | }, 28 | "dependencies": { 29 | "acorn": "^8.12.1", 30 | "magic-string": "^0.30.11", 31 | "vite-plugin-dynamic-import": "^1.6.0" 32 | }, 33 | "devDependencies": { 34 | "@types/node": "^22.5.2", 35 | "fast-glob": "^3.3.2", 36 | "node-fetch": "^3.3.2", 37 | "typescript": "^5.6.2", 38 | "vite": "^4.4.5", 39 | "vite-plugin-utils": "^0.4.5", 40 | "vitest": "^2.1.1" 41 | }, 42 | "keywords": [ 43 | "vite", 44 | "plugin", 45 | "commonjs", 46 | "require" 47 | ], 48 | "files": [ 49 | "dist" 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /test/serve.test.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs' 2 | import path from 'node:path' 3 | import { 4 | type ViteDevServer, 5 | createServer, 6 | } from 'vite' 7 | import { 8 | afterAll, 9 | beforeAll, 10 | describe, 11 | expect, 12 | it, 13 | } from 'vitest' 14 | import fetch from 'node-fetch' 15 | import fastGlob from 'fast-glob' 16 | 17 | const root = path.join(__dirname, 'fixtures') 18 | let server: ViteDevServer | null = null 19 | let port = 4000 20 | 21 | beforeAll(async () => { 22 | fs.rmSync(path.join(root, 'dist'), { recursive: true, force: true }) 23 | server = await createServer({ configFile: path.join(root, 'vite.config.ts') }) 24 | await server.listen(port) 25 | // @ts-ignore 26 | port = server.httpServer?.address().port 27 | }) 28 | 29 | describe('vite serve', async () => { 30 | it('__snapshots__', async () => { 31 | const files = fastGlob.sync('__snapshots__/**/*', { cwd: root }) 32 | for (const file of files) { 33 | const response = await (await fetch(`http://localhost:${port}/${file.replace('__snapshots__', 'src')}`)).text() 34 | const distFile = fs.readFileSync(path.join(root, file.replace('__snapshots__', 'dist')), 'utf8') 35 | const snapFile = fs.readFileSync(path.join(root, file), 'utf8') 36 | 37 | expect(response).string 38 | expect(distFile).eq(snapFile) 39 | } 40 | }) 41 | }) 42 | 43 | afterAll(async () => { 44 | await server?.close() 45 | server = null 46 | }) 47 | -------------------------------------------------------------------------------- /test/fixtures/v0.3.2/output.js: -------------------------------------------------------------------------------- 1 | /* Declaration-promotion-S */ import * as __CJS_import__2__ from 'uninstalled-external-module'; import * as __CJS_import__6__ from '@angular/core'; import * as __CJS_import__7__ from '@angular/core'; import * as __CJS_import__8__ from './input'; import * as __CJS_import__9__ from './b'; import * as __CJS_import__10__ from './c'; import * as __CJS_import__11__ from './Home.vue'; import * as __CJS_import__12__ from 'undefined'; import * as __CJS_import__13__ from 'undefined'; import * as __CJS_import__14__ from './if-id'; import * as __CJS_import__15__ from './if-id'; /* Declaration-promotion-E */import 'path'; 2 | import 'path'; 3 | 4 | try { 5 | // TODO 6 | __CJS_import__2__; 7 | } catch (ignored) { 8 | /* ignore */ 9 | } 10 | 11 | import * as fs from 'fs'; 12 | import { readFile } from 'fs'; 13 | import { stat, cp as cpAlias } from 'fs'; 14 | 15 | const modules = [ 16 | __CJS_import__6__, 17 | __CJS_import__7__.default.value, 18 | ]; 19 | 20 | const json = { 21 | a: __CJS_import__8__, 22 | b: __CJS_import__9__.b(), 23 | c: [ 24 | __CJS_import__10__, 25 | ], 26 | }; 27 | 28 | const routes = [ 29 | { 30 | name: 'Home', 31 | component: __CJS_import__11__, 32 | }, 33 | ]; 34 | 35 | function load(path) { 36 | // TODO 37 | __CJS_import__12__; 38 | } 39 | 40 | // TODO 41 | const load2 = path => __CJS_import__13__; 42 | 43 | // ---- v0.3.2 ---- 44 | 45 | if (__CJS_import__14__.func()) { 46 | __CJS_import__15__.foo.bar 47 | } 48 | -------------------------------------------------------------------------------- /src/generate-export-v0.9.0.txt: -------------------------------------------------------------------------------- 1 | import type { Analyzed } from './analyze' 2 | 3 | export interface ExportsRuntime { 4 | polyfill: string 5 | exportDeclaration: string 6 | } 7 | 8 | export function generateExport(analyzed: Analyzed): ExportsRuntime | null { 9 | if (!analyzed.exports.length) { 10 | return null 11 | } 12 | 13 | const memberDefault = analyzed.exports 14 | // Find `module.exports` or `exports.default` 15 | .find(exp => exp.token.left === 'module' || exp.token.right === 'default') 16 | 17 | let members = analyzed.exports 18 | // Exclude `module.exports` and `exports.default` 19 | .filter(exp => exp.token.left !== 'module' && exp.token.right !== 'default') 20 | .map(exp => exp.token.right) 21 | // Remove duplicate export 22 | members = [...new Set(members)] 23 | 24 | const membersDeclaration = members.map( 25 | m => `const __CJS__export_${m}__ = (module.exports == null ? {} : module.exports).${m}`, 26 | ) 27 | const membersExport = members.map(m => `__CJS__export_${m}__ as ${m}`) 28 | if (memberDefault) { 29 | membersDeclaration.unshift(`const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports`) 30 | membersExport.unshift('__CJS__export_default__ as default') 31 | } 32 | 33 | return { 34 | polyfill: 'var module = { exports: {} }; var exports = module.exports;', 35 | exportDeclaration: ` 36 | ${membersDeclaration.join(';\n')}; 37 | export { 38 | ${membersExport.join(',\n ')}, 39 | } 40 | `.trim(), 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/generate-export.ts: -------------------------------------------------------------------------------- 1 | import type { Analyzed } from './analyze' 2 | 3 | export interface ExportsRuntime { 4 | polyfill: string 5 | exportDeclaration: string 6 | } 7 | 8 | export function generateExport(analyzed: Analyzed): ExportsRuntime | null { 9 | if (!analyzed.exports.length) { 10 | return null 11 | } 12 | 13 | // Since the `v0.10.0` version, it no longer matches whether there is an `exports.default` member, but exports directly. 14 | // Because Vite will add `interop` related code snippets after the `import()` statement. 15 | // `interop` snippets 👉 https://github.com/vitejs/vite/blob/v4.4.11/packages/vite/src/node/plugins/importAnalysis.ts#L874 16 | // Check needs interop 👉 https://github.com/vitejs/vite/blob/v4.4.11/packages/vite/src/node/optimizer/index.ts#L1165-L1166 17 | const memberDefault = { 18 | declaration: 'const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports', 19 | export: '__CJS__export_default__ as default', 20 | } 21 | 22 | let members = analyzed.exports 23 | // Exclude `module.exports` and `exports.default` 24 | .filter(exp => exp.token.left !== 'module' && exp.token.right !== 'default') 25 | .map(exp => exp.token.right) 26 | // Remove duplicate export 27 | members = [...new Set(members)] 28 | 29 | const membersDeclaration = [ 30 | memberDefault.declaration, 31 | ...members.map(m => `const __CJS__export_${m}__ = (module.exports == null ? {} : module.exports).${m}`), 32 | ] 33 | const membersExport = [ 34 | memberDefault.export, 35 | ...members.map(m => `__CJS__export_${m}__ as ${m}`), 36 | ] 37 | 38 | return { 39 | polyfill: 'var module = { exports: {} }; var exports = module.exports;', 40 | exportDeclaration: ` 41 | ${membersDeclaration.join(';\n')}; 42 | export { 43 | ${membersExport.join(',\n ')}, 44 | } 45 | `.trim(), 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vite.config.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs' 2 | import path from 'node:path' 3 | import { spawn } from 'node:child_process' 4 | import { builtinModules } from 'node:module' 5 | import { defineConfig } from 'vite' 6 | import pkg from './package.json' 7 | 8 | const isdev = process.argv.slice(2).includes('--watch') 9 | 10 | export default defineConfig({ 11 | build: { 12 | minify: false, 13 | emptyOutDir: !isdev, 14 | target: 'node14', 15 | lib: { 16 | entry: 'src/index.ts', 17 | formats: ['cjs', 'es'], 18 | fileName: format => format === 'es' ? '[name].mjs' : '[name].js', 19 | }, 20 | rollupOptions: { 21 | external: [ 22 | 'vite', 23 | ...builtinModules, 24 | ...builtinModules.map(m => `node:${m}`), 25 | ...Object.keys('dependencies' in pkg ? pkg.dependencies as object : {}), 26 | ], 27 | output: { 28 | exports: 'named', 29 | }, 30 | }, 31 | }, 32 | plugins: [{ 33 | name: 'generate-types', 34 | async closeBundle() { 35 | if (process.env.NODE_ENV === 'test') return 36 | 37 | removeTypes() 38 | await generateTypes() 39 | moveTypesToDist() 40 | removeTypes() 41 | }, 42 | }], 43 | }) 44 | 45 | function removeTypes() { 46 | fs.rmSync(path.join(__dirname, 'types'), { recursive: true, force: true }) 47 | } 48 | 49 | function generateTypes() { 50 | return new Promise(resolve => { 51 | const cp = spawn( 52 | process.platform === 'win32' ? 'npm.cmd' : 'npm', 53 | ['run', 'types'], 54 | { stdio: 'inherit' }, 55 | ) 56 | cp.on('exit', code => { 57 | !code && console.log('[types]', 'declaration generated') 58 | resolve(code) 59 | }) 60 | cp.on('error', process.exit) 61 | }) 62 | } 63 | 64 | function moveTypesToDist() { 65 | const types = path.join(__dirname, 'types') 66 | const dist = path.join(__dirname, 'dist') 67 | const files = fs.readdirSync(types).filter(n => n.endsWith('.d.ts')) 68 | for (const file of files) { 69 | fs.copyFileSync(path.join(types, file), path.join(dist, file)) 70 | console.log('[types]', `types/${file} -> dist/${file}`) 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | .DS_Store 107 | 108 | package-lock.json 109 | pnpm-lock.yaml 110 | # yarn.lock 111 | 112 | /types 113 | -------------------------------------------------------------------------------- /test/fixtures/v0.4.7/output.js: -------------------------------------------------------------------------------- 1 | /* export-runtime-S */ const module = { exports: {} }; const exports = module.exports; /* export-runtime-E *//* import-promotion-S */ import * as __CJS__import__2__ from 'foo'; import * as __CJS__import__8__ from 'foo'; import * as __CJS__import__9__ from 'foo'; import * as __CJS__import__11__ from 'foo'; import * as __CJS__import__12__ from 'foo'; import * as __CJS__import__13__ from 'foo'; import * as __CJS__import__14__ from 'foo'; import * as __CJS__import__15__ from '@/views/home.vue'; import * as __CJS__import__16__ from 'foo'; import * as __CJS__import__17__ from 'foo'; import * as __CJS__import__18__ from 'foo'; /* import-promotion-E */ 2 | import 'foo'; 3 | import 'foo'; 4 | __CJS__import__2__.bar(); 5 | 6 | import * as foo from 'foo'; 7 | import fooDefault from 'foo'; 8 | import __CJS__import__5__ from 'foo'; const { f1, f2 : f22, f3 } = __CJS__import__5__; 9 | import { bar as __CJS__import__6__ } from 'foo'; const { b1, b2 : b22, b3 } = __CJS__import__6__; 10 | import { bar } from 'foo'; 11 | const baz = __CJS__import__8__.bar.baz; 12 | const { z1, z2: z22 } = __CJS__import__9__.baz(); 13 | 14 | import * as foo_require from 'foo'; 15 | exports.foo_require = foo_require; 16 | exports.foo = __CJS__import__11__; 17 | exports.bar = __CJS__import__12__.bar; 18 | exports.bar = __CJS__import__13__.bar.baz; 19 | module.exports = __CJS__import__14__.bar.baz; 20 | exports.default = module.exports; 21 | 22 | const routes = [{ 23 | path: '/', 24 | component: __CJS__import__15__, 25 | }]; 26 | 27 | if (__CJS__import__16__.bar) { 28 | const result = __CJS__import__17__.bar.baz(); 29 | if (result) { 30 | module.exports = __CJS__import__18__.bar.baz(); 31 | } 32 | } 33 | 34 | function fn1(path) { 35 | import/*🚧-🐞*/(path).then(m => m.default || m); 36 | }/* export-statement-S */ 37 | const __CJS__export_default__ = (module.exports == null ? {} : module.exports).default || module.exports; 38 | const __CJS__export_foo_require__ = (module.exports == null ? {} : module.exports).foo_require; 39 | const __CJS__export_foo__ = (module.exports == null ? {} : module.exports).foo; 40 | const __CJS__export_bar__ = (module.exports == null ? {} : module.exports).bar; 41 | export { 42 | __CJS__export_default__ as default, 43 | __CJS__export_foo_require__ as foo_require, 44 | __CJS__export_foo__ as foo, 45 | __CJS__export_bar__ as bar, 46 | } 47 | /* export-statement-E */ -------------------------------------------------------------------------------- /src/generate-import.ts: -------------------------------------------------------------------------------- 1 | import type { CommonjsOptions, ImportInteropType } from 'src' 2 | import type { Analyzed } from './analyze' 3 | 4 | export interface ImportRecord { 5 | node: AcornNode 6 | importExpression?: string 7 | importInterop?: string 8 | } 9 | 10 | export function generateImport(analyzed: Analyzed, id: string, options: CommonjsOptions) { 11 | const { importRules } = options.advanced ?? {} 12 | const imports: ImportRecord[] = [] 13 | let count = 0 14 | 15 | for (const { node, dynamic } of analyzed.require) { 16 | 17 | // Handled in `dynamic-require.ts` 18 | if (dynamic === 'dynamic') continue 19 | 20 | const impt: ImportRecord = { node } 21 | const importName = `__CJS__import__${count++}__` 22 | 23 | const requireIdNode = node.arguments[0] 24 | let requireId: string 25 | if (!requireIdNode) continue // Not value - require() 26 | if (requireIdNode.type === 'Literal') { 27 | requireId = requireIdNode.value 28 | } else if (dynamic === 'Literal') { 29 | requireId = requireIdNode.quasis[0].value.raw 30 | } 31 | 32 | if (!requireId!) { 33 | const codeSnippets = analyzed.code.slice(node.start, node.end) 34 | throw new Error(`The following require statement cannot be converted. 35 | -> ${codeSnippets} 36 | ${'^'.repeat(codeSnippets.length)}`) 37 | } 38 | 39 | // This is probably less accurate, but is much cheaper than a full AST parse. 40 | let importInterop: ImportInteropType | string = 'defaultFirst' 41 | if (typeof importRules === 'string') { 42 | importInterop = importRules 43 | } else if (typeof importRules === 'function') { 44 | importInterop = importRules(id) 45 | } 46 | 47 | impt.importExpression = `import * as ${importName} from "${requireId}"` 48 | switch (importInterop) { 49 | case 'defaultFirst': 50 | impt.importInterop = `${importName}.default || ${importName}` 51 | break 52 | case 'namedFirst': 53 | impt.importInterop = `Object.keys(${importName}).join('') !== "default" ? ${importName} : ${importName}.default` 54 | break 55 | case 'merge': 56 | impt.importInterop = `${importName}.default ? Object.assign(${importName}.default, ${importName}) : ${importName}` 57 | break 58 | default: 59 | // User-defined module interop. 60 | impt.importInterop = importInterop // string | undefined 61 | } 62 | 63 | imports.push(impt) 64 | } 65 | 66 | return imports 67 | } 68 | -------------------------------------------------------------------------------- /src/analyze.ts: -------------------------------------------------------------------------------- 1 | import { walk } from 'vite-plugin-utils/function' 2 | 3 | // ①(🎯): Top-level scope statement types, it also means statements that can be converted 4 | // 顶级作用于语句类型,这种可以被无缝换成 import 5 | export enum TopScopeType { 6 | // require('foo')[.bar] 7 | ExpressionStatement = 'ExpressionStatement', 8 | // const bar = require('foo')[.bar] 9 | VariableDeclaration = 'VariableDeclaration', 10 | } 11 | 12 | export interface RequireStatement { 13 | /** CallExpression */ 14 | node: AcornNode 15 | ancestors: AcornNode[] 16 | /** 17 | * If require statement located top-level scope ant it is convertible, this will have a value(🎯-①) 18 | * 如果 require 在顶级作用于,并且是可转换 import 的,那么 topScopeNode 将会被赋值 19 | * @deprecated 🤔 20 | */ 21 | topScopeNode?: AcornNode & { type: TopScopeType } 22 | dynamic?: 23 | | 'dynamic' 24 | // e.g. require(`@/foo/bar.js`) 25 | | 'Literal' 26 | } 27 | 28 | export interface ExportsStatement { 29 | node: AcornNode 30 | // module(left).exports(right) = 'foo' 31 | // exports(left).bar(right) = 'bar' 32 | token: { 33 | left: string 34 | right: string 35 | } 36 | } 37 | 38 | export interface Analyzed { 39 | ast: AcornNode 40 | code: string 41 | id: string 42 | require: RequireStatement[] 43 | exports: ExportsStatement[] 44 | } 45 | 46 | /** 47 | * `require` statement analyzer 48 | * require 语法分析器 49 | */ 50 | export function analyzer(ast: AcornNode, code: string, id: string): Analyzed { 51 | 52 | const analyzed: Analyzed = { 53 | ast, 54 | code, 55 | id, 56 | require: [], 57 | exports: [], 58 | } 59 | 60 | walk.sync(ast, { 61 | CallExpression(node, ancestors) { 62 | if (node.callee.name !== 'require') return 63 | 64 | const dynamic = checkDynamicId(node) 65 | 66 | analyzed.require.push({ 67 | node, 68 | ancestors, 69 | topScopeNode: dynamic === 'dynamic' 70 | ? undefined 71 | : findTopLevelScope(ancestors) as RequireStatement['topScopeNode'], 72 | dynamic, 73 | }) 74 | }, 75 | AssignmentExpression(node) { 76 | if (node.left.type !== 'MemberExpression') return 77 | // only `module.exports`, `exports.xxx` 78 | if (!['module', 'exports'].includes(node.left.object.name)) return 79 | 80 | analyzed.exports.push({ 81 | node, 82 | token: { 83 | left: node.left.object.name, 84 | right: node.left.property.name, 85 | }, 86 | }) 87 | }, 88 | }) 89 | 90 | return analyzed 91 | } 92 | 93 | function checkDynamicId(node: AcornNode): RequireStatement['dynamic'] { 94 | if ( 95 | node.arguments[0]?.type === 'TemplateLiteral' && 96 | node.arguments[0]?.quasis.length === 1 97 | ) { 98 | // e.g. require(`@/foo/bar.js`) 99 | return 'Literal' 100 | } 101 | 102 | // Only `require` with one-argument is supported 103 | return node.arguments[0]?.type !== 'Literal' ? 'dynamic' : undefined 104 | } 105 | 106 | // At present, only the "MemberExpression" of the one-depth is considered as the top-level scope 107 | // 当前,只认为一层的 MemberExpression 顶级作用域 108 | // e.g. 109 | // ✅ require('foo').bar 110 | // ❌ require('foo').bar.baz 111 | // 112 | // Will be return nearset scope ancestor node (🎯-①) 113 | // 这将返回最近作用域的祖先节点 114 | function findTopLevelScope(ancestors: AcornNode[]): AcornNode | undefined { 115 | const ances = ancestors.map(an => an.type).join() 116 | const arr = [...ancestors].reverse() 117 | 118 | // TODO: better top-scope detect 119 | 120 | if (/Program,ExpressionStatement,(MemberExpression,)?CallExpression$/.test(ances)) { 121 | // Program,ExpressionStatement,CallExpression | require('foo') 122 | // Program,ExpressionStatement,MemberExpression,CallExpression | require('foo').bar 123 | return arr.find(e => e.type === TopScopeType.ExpressionStatement) 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /src/dynamic-require.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path' 2 | import type { ResolvedConfig } from 'vite' 3 | import { 4 | Resolve, 5 | mappingPath, 6 | globFiles, 7 | } from 'vite-plugin-dynamic-import' 8 | import { normalizePath, COLOURS } from 'vite-plugin-utils/function' 9 | import { 10 | type CommonjsOptions, 11 | TAG, 12 | } from '.' 13 | import type { Analyzed } from './analyze' 14 | 15 | export interface DynamicRequireRecord { 16 | node: AcornNode 17 | /** normally path */ 18 | normally?: string 19 | dynamic?: { 20 | importee: string[] 21 | runtimeName: string 22 | runtimeFn: string 23 | } 24 | } 25 | 26 | export class DynamicRequire { 27 | 28 | constructor( 29 | private config: ResolvedConfig, 30 | private options: CommonjsOptions & { extensions: string[] }, 31 | private resolve = new Resolve(config), 32 | ) { } 33 | 34 | public async generateRuntime(analyzed: Analyzed): Promise { 35 | const options = this.options 36 | const id = analyzed.id 37 | let counter = 0 38 | const importCache = new Map(/* import-id, import-name */) 39 | const records: DynamicRequireRecord[] = [] 40 | 41 | for (const { dynamic, node } of analyzed.require) { 42 | if (dynamic !== 'dynamic') continue 43 | 44 | const importExpression = analyzed.code.slice(node.start, node.end) 45 | const globResult = await globFiles({ 46 | importeeNode: node.arguments[0], 47 | importExpression, 48 | importer: analyzed.id, 49 | resolve: this.resolve, 50 | extensions: this.options.extensions, 51 | loose: options.dynamic?.loose !== false, 52 | }) 53 | if (!globResult) continue 54 | const record: DynamicRequireRecord = { node } 55 | 56 | let { files, resolved, normally } = globResult 57 | 58 | if (normally) { 59 | record.normally = normally 60 | continue 61 | } 62 | 63 | if (!files?.length) { 64 | console.log( 65 | TAG, 66 | COLOURS.yellow(`no files matched: ${importExpression}\n`), 67 | ` file: ${analyzed.id}`, 68 | ) 69 | continue 70 | } 71 | 72 | // skip itself 73 | files = files.filter(f => normalizePath(path.join(path.dirname(id), f)) !== id) 74 | // execute the dynamic.onFiles 75 | options.dynamic?.onFiles && (files = options.dynamic?.onFiles(files, id) || files) 76 | 77 | const maps = mappingPath( 78 | files, 79 | resolved ? { [resolved.alias.relative]: resolved.alias.findString } : undefined, 80 | ) 81 | let counter2 = 0 82 | record.dynamic = { 83 | importee: [], 84 | runtimeName: `__matchRequireRuntime${counter++}__`, 85 | runtimeFn: '', // to be immediately set 86 | } 87 | 88 | const cases: string[] = [] 89 | for (const [localFile, importeeList] of Object.entries(maps)) { 90 | let dynamic_require2import = importCache.get(localFile) 91 | if (!dynamic_require2import) { 92 | importCache.set( 93 | localFile, 94 | dynamic_require2import = `__dynamic_require2import__${counter}__${counter2++}`, 95 | ) 96 | } 97 | 98 | record.dynamic.importee.push(`import * as ${dynamic_require2import} from '${localFile}'`) 99 | cases.push(importeeList 100 | .map(importee => ` case '${importee}':`) 101 | .concat(` return ${dynamic_require2import};`) 102 | .join('\n')) 103 | } 104 | 105 | record.dynamic.runtimeFn = `function ${record.dynamic.runtimeName}(path) { 106 | switch(path) { 107 | ${cases.join('\n')} 108 | default: throw new Error("Cann't found module: " + path); 109 | } 110 | }` 111 | 112 | records.push(record) 113 | } 114 | 115 | return records.length ? records : null 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # vite-plugin-commonjs 2 | 一个纯 JavaScript 实现的 vite-plugin-commonjs 3 | 4 | [![NPM version](https://img.shields.io/npm/v/vite-plugin-commonjs.svg?style=flat)](https://npmjs.org/package/vite-plugin-commonjs) 5 | [![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-commonjs.svg?style=flat)](https://npmjs.org/package/vite-plugin-commonjs) 6 | 7 | [English](https://github.com/vite-plugin/vite-plugin-commonjs#readme) | 简体中文 8 | 9 | ✅ alias 10 | ✅ bare module(node_modules) 11 | ✅ dynamic-require 和 👉 [Webpack](https://webpack.js.org/guides/dependency-management/#require-with-expression) `require('./foo/' + bar)`类似 12 | 13 | ## [细说 Vite 构建 CommonJS 问题](./commonjs.zh-CN.md) 14 | 15 | ## 使用 16 | 17 | ```js 18 | import commonjs from 'vite-plugin-commonjs' 19 | 20 | export default { 21 | plugins: [ 22 | commonjs(/* options */), 23 | ] 24 | } 25 | ``` 26 | 27 | ## API (Define) 28 | 29 | ```ts 30 | export interface Options { 31 | filter?: (id: string) => boolean | undefined 32 | dynamic?: { 33 | /** 34 | * 1. `true` - 尽量匹配所有可能场景, 功能更像 `webpack` 35 | * 2. `false` - 功能更像rollup的 `@rollup/plugin-dynamic-import-vars`插件 36 | * @default true 37 | */ 38 | loose?: boolean 39 | /** 40 | * 如果你想排除一些文件 41 | * e.g. 42 | * ```js 43 | * commonjs({ 44 | * dynamic: { 45 | * onFiles: files => files.filter(f => f !== 'types.d.ts') 46 | * } 47 | * }) 48 | * ``` 49 | */ 50 | onFiles?: (files: string[], id: string) => typeof files | undefined 51 | } 52 | advanced?: { 53 | /** 自定义 import 语句 */ 54 | importRules?: ImportType | ((id: string) => ImportType) 55 | } 56 | } 57 | ``` 58 | 59 | #### node_modules 60 | 61 | ```js 62 | commonjs({ 63 | filter(id) { 64 | // 默认会排除 `node_modules`,所以必须显式的包含它explicitly 65 | // https://github.com/vite-plugin/vite-plugin-commonjs/blob/v0.7.0/src/index.ts#L125-L127 66 | if (id.includes('node_modules/xxx')) { 67 | return true 68 | } 69 | } 70 | }) 71 | ``` 72 | 73 | ## 案例 74 | 75 | [vite-plugin-commonjs/test](https://github.com/vite-plugin/vite-plugin-commonjs/tree/main/test) 76 | 77 | ✅ require 声明 78 | 79 | ```js 80 | // 顶级作用域 81 | const foo = require('foo').default 82 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 83 | import foo from 'foo' 84 | 85 | const foo = require('foo') 86 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 87 | import * as foo from 'foo' 88 | 89 | const foo = require('foo').bar 90 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 91 | import * as __CJS_import__0__ from 'foo'; const { bar: foo } = __CJS_import__0__ 92 | 93 | // 非顶级作用域 94 | const foo = [{ bar: require('foo').bar }] 95 | ↓ 96 | import * as __CJS_import__0__ from 'foo'; const foo = [{ bar: __CJS_import__0__.bar }] 97 | ``` 98 | 99 | ✅ exports 声明 100 | 101 | ```js 102 | module.exports = fn() { } 103 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 104 | const __CJS__export_default__ = module.exports = fn() { } 105 | export { __CJS__export_default__ as default } 106 | 107 | exports.foo = 'foo' 108 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 109 | const __CJS__export_foo__ = (module.exports == null ? {} : module.exports).foo 110 | export { __CJS__export_foo__ as foo } 111 | ``` 112 | 113 | ✅ dynamic-require 声明 114 | 115 | *我们假设项目结构如下* 116 | 117 | ```tree 118 | ├─┬ src 119 | │ ├─┬ views 120 | │ │ ├─┬ foo 121 | │ │ │ └── index.js 122 | │ │ └── bar.js 123 | │ └── router.js 124 | └── vite.config.js 125 | ``` 126 | 127 | ```js 128 | // router.js 129 | function load(name: string) { 130 | return require(`./views/${name}`) 131 | } 132 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 133 | import * as __dynamic_require2import__0__0 from './views/foo/index.js' 134 | import * as __dynamic_require2import__0__1 from './views/bar.js' 135 | function load(name: string) { 136 | return __matchRequireRuntime0__(`./views/${name}`) 137 | } 138 | function __matchRequireRuntime0__(path) { 139 | switch(path) { 140 | case './views/foo': 141 | case './views/foo/index': 142 | case './views/foo/index.js': 143 | return __dynamic_require2import__0__0; 144 | case './views/bar': 145 | case './views/bar.js': 146 | return __dynamic_require2import__0__1; 147 | default: throw new Error("Cann't found module: " + path); 148 | } 149 | } 150 | ``` 151 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vite-plugin-commonjs 2 | A pure JavaScript implementation of CommonJs 3 | 4 | [![NPM version](https://img.shields.io/npm/v/vite-plugin-commonjs.svg?style=flat)](https://npmjs.org/package/vite-plugin-commonjs) 5 | [![NPM Downloads](https://img.shields.io/npm/dm/vite-plugin-commonjs.svg?style=flat)](https://npmjs.org/package/vite-plugin-commonjs) 6 | 7 | English | [简体中文](https://github.com/vite-plugin/vite-plugin-commonjs/blob/main/README.zh-CN.md) 8 | 9 | ✅ alias 10 | ✅ bare module(node_modules) 11 | ✅ dynamic-require similar to 👉 [Webpack](https://webpack.js.org/guides/dependency-management/#require-with-expression) `require('./foo/' + bar)` 12 | 13 | ## [Elaborate on Vite building CommonJS issues](./commonjs.zh-CN.md) 14 | 15 | ## Usage 16 | 17 | ```js 18 | import commonjs from 'vite-plugin-commonjs' 19 | 20 | export default { 21 | plugins: [ 22 | commonjs(/* options */), 23 | ] 24 | } 25 | ``` 26 | 27 | ## API (Define) 28 | 29 | ```ts 30 | export interface CommonjsOptions { 31 | filter?: (id: string) => boolean | undefined 32 | dynamic?: { 33 | /** 34 | * 1. `true` - Match all possibilities as much as possible, more like `webpack` 35 | * 2. `false` - It behaves more like `@rollup/plugin-dynamic-import-vars` 36 | * @default true 37 | */ 38 | loose?: boolean 39 | /** 40 | * If you want to exclude some files 41 | * e.g. 42 | * ```js 43 | * commonjs({ 44 | * dynamic: { 45 | * onFiles: files => files.filter(f => f !== 'types.d.ts') 46 | * } 47 | * }) 48 | * ``` 49 | */ 50 | onFiles?: (files: string[], id: string) => typeof files | undefined 51 | } 52 | advanced?: { 53 | /** 54 | * Custom import module interop behavior. 55 | * 56 | * If you want to fully customize the interop behavior, 57 | * you can pass a function and return the interop code snippet. 58 | */ 59 | importRules?: ImportInteropType | ((id: string) => ImportInteropType | string) 60 | } 61 | } 62 | ``` 63 | 64 | #### node_modules 65 | 66 | ```js 67 | commonjs({ 68 | filter(id) { 69 | // `node_modules` is exclude by default, so we need to include it explicitly 70 | // https://github.com/vite-plugin/vite-plugin-commonjs/blob/v0.7.0/src/index.ts#L125-L127 71 | if (id.includes('node_modules/xxx')) { 72 | return true 73 | } 74 | } 75 | }) 76 | ``` 77 | 78 | ## Cases 79 | 80 | [vite-plugin-commonjs/test](https://github.com/vite-plugin/vite-plugin-commonjs/tree/main/test) 81 | 82 | ✅ require statement 83 | 84 | ```js 85 | // Top-level scope 86 | const foo = require('foo').default 87 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 88 | import foo from 'foo' 89 | 90 | const foo = require('foo') 91 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 92 | import * as foo from 'foo' 93 | 94 | const foo = require('foo').bar 95 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 96 | import * as __CJS_import__0__ from 'foo'; const { bar: foo } = __CJS_import__0__ 97 | 98 | // Non top-level scope 99 | const foo = [{ bar: require('foo').bar }] 100 | ↓ 101 | import * as __CJS_import__0__ from 'foo'; const foo = [{ bar: __CJS_import__0__.bar }] 102 | ``` 103 | 104 | ✅ exports statement 105 | 106 | ```js 107 | module.exports = fn() { } 108 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 109 | const __CJS__export_default__ = module.exports = fn() { } 110 | export { __CJS__export_default__ as default } 111 | 112 | exports.foo = 'foo' 113 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 114 | const __CJS__export_foo__ = (module.exports == null ? {} : module.exports).foo 115 | export { __CJS__export_foo__ as foo } 116 | ``` 117 | 118 | ✅ dynamic-require statement 119 | 120 | *We assume that the project structure is as follows* 121 | 122 | ```tree 123 | ├─┬ src 124 | │ ├─┬ views 125 | │ │ ├─┬ foo 126 | │ │ │ └── index.js 127 | │ │ └── bar.js 128 | │ └── router.js 129 | └── vite.config.js 130 | ``` 131 | 132 | ```js 133 | // router.js 134 | function load(name: string) { 135 | return require(`./views/${name}`) 136 | } 137 | // ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ 138 | import * as __dynamic_require2import__0__0 from './views/foo/index.js' 139 | import * as __dynamic_require2import__0__1 from './views/bar.js' 140 | function load(name: string) { 141 | return __matchRequireRuntime0__(`./views/${name}`) 142 | } 143 | function __matchRequireRuntime0__(path) { 144 | switch(path) { 145 | case './views/foo': 146 | case './views/foo/index': 147 | case './views/foo/index.js': 148 | return __dynamic_require2import__0__0; 149 | case './views/bar': 150 | case './views/bar.js': 151 | return __dynamic_require2import__0__1; 152 | default: throw new Error("Cann't found module: " + path); 153 | } 154 | } 155 | ``` 156 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.10.4 (2024-11-21) 2 | 3 | - b1ff4b6 feat: bump vite-plugin-utils to 0.4.4 to support `.cjs`, `.cts` extension by default 4 | - debe58a fix: bump vite-plugin-utils to 0.4.4 for large cjs bundles #62 5 | 6 | ## 0.10.3 (2023-09-16) 7 | 8 | - e369497 chore: bump deps 9 | - 7c9ee77 fix: works with `@vitejs/plugin-vue2` #49 10 | 11 | ## 0.10.2 (2023-09-15) 12 | 13 | - 7704cd4 chore: add comments 14 | - 5c3e702 bugfix #54 15 | - 5e3294e docs: add commonjs.zh-CN.md link 16 | - ff77d51 feat: add commonjs.zh-CN.md, commonjs.jpg 17 | 18 | ## 0.10.1 (2023-11-14) 19 | 20 | - 492aab3 fix(#42): auto-increment dynamic require id 21 | 22 | ## 0.10.0 (2023-10-08) 23 | 24 | - c286fe2 chore: backup files 25 | - f1e672b chore: update test v0.10.0 26 | - 63324c2 chore: backup export 27 | - 2eefcbc fix: always export `default` 28 | - de0a56e feat: supports full module interop 29 | 30 | ## 0.9.0 (2023-08-26) 31 | 32 | - 49e77ca chore: update test 33 | - 61a9fe5 chore: code format 34 | - c1e1ceb feat: support advanced import rules option 35 | 36 | #### PR 37 | 38 | - @Jinjiang feat: support advanced import rules option #35 39 | 40 | ## 0.8.2 (2023-07-17) 41 | 42 | - feat: update to ES2023 #32, closes [#32](https://github.com/vite-plugin/vite-plugin-commonjs/issues/32) 43 | 44 | ## 0.8.1 (2023-07-12) 45 | 46 | - dfd8742 feat: generate sourcemap #28 47 | - 4257aa6 chore: remove `build.test.ts` 48 | - 23b7cdf fix: correct esbuild loader 49 | - ef781ec Merge pull request #29 from vite-plugin/v0.8.0 50 | 51 | ## 0.8.0 (2023-06-24) 52 | 53 | - bf2f306 fix: dynamic-require typo #28, closes [#28](https://github.com/vite-plugin/vite-plugin-commonjs/issues/28) 54 | - 66ce5dd feat: support build 55 | 56 | ## 0.7.1 (2023-05-14) 57 | 58 | - ddfbfeb fix: bump vite-plugin-dynamic-import to 1.4.0 for `pnpm` 59 | - 356c22e chore: cleanup 60 | - 4e4f807 docs: update 61 | 62 | ## 0.7.0 (2023-04-30) 63 | 64 | - e9eb5f0 refactor(test): integrate vitest 🌱 65 | - 0c892f1 chore: bump deps 66 | - 750fd4b chore: cleanup 67 | - 4691bcc feat: `glob` files log 68 | - 80f46f0 refactor: cleanup 69 | - 7d6a47f chore: backup `v0.5.3` 70 | - 782db06 docs: v0.7.0 71 | - d3207f3 refactor(build): better scripts 72 | - e69a65a refactor: better support `node_modules` #23 73 | - 62a8cd9 chore: cleanup types 74 | 75 | ## 0.6.2 (2023-03-12) 76 | 77 | - enhancement: support node_modules | #19 78 | 79 | ## 0.6.1 (2022-12-10) 80 | 81 | - b163947 v0.6.1 82 | - 232042f feat: cjs examples 83 | - 4ad7a9b fix: `var` instead `const` #17 84 | 85 | ```diff 86 | - const module = { exports: {} }; const exports = module.exports; 87 | + var module = { exports: {} }; var exports = module.exports; 88 | ``` 89 | 90 | ## 0.6.0 (2022-11-27) 91 | 92 | #### More like Vite, loose syntax! 93 | 94 | **0.6.x** 95 | 96 | ```js 97 | const { foo } = require('foo') 98 | ↓ 99 | const { foo } = __CJS__import__0__.default || __CJS__import__0__ 100 | ``` 101 | 102 | ```js 103 | const bar = require('bar') 104 | ↓ 105 | import * as __CJS__import__0__ from '/bar' 106 | const bar = __CJS__import__0__.default || __CJS__import__0__ 107 | ``` 108 | 109 | **0.5.x** 110 | 111 | ```js 112 | const { foo } = require('foo') 113 | ↓ 114 | import { foo } from 'foo' 115 | ``` 116 | 117 | ```js 118 | const bar = require('bar') 119 | ↓ 120 | import * as __CJS__import__0__ from '/bar' 121 | const bar = __CJS__import__0__ 122 | ``` 123 | 124 | #### Main commit 125 | 126 | - eda5464 v0.6.0 127 | - b5f7089 refactor!: loose syntax convert #15 128 | 129 | ## 0.5.3 (2022-10-16) 130 | 131 | - ee0a882 `src-output` -> `__snapshots__` 132 | - 16593ff v0.5.3 133 | - 2a5752b docs: v0.5.3 134 | - 236730a refactor: use vite-plugin-utils 135 | - bb793a5 chore: update config 136 | - 1148671 feat: support `"type": "module"` 137 | - f590da1 chore: `"strict": true` 138 | - cf98458 bump deps 139 | - 04f95f7 chore: bump deps 140 | - 0434172 chore: update comments 141 | 142 | --- 143 | 144 | ## [2022-05-04] v0.3.0 145 | 146 | - 🔨 Refactor v0.2.6 | 0d694c438db42b0283ff949e694e2e8fbeca6785 147 | - 🌱 Add test | 419be39fc2a74edec6dc453e7ffa8cc99e76bbf4 148 | 149 | ## [2022-05-04] v0.3.2 150 | 151 | - 🌱 Support all require-statement | ef8691e 152 | - 🌱 Add samples | 8bbcc7a 153 | 154 | ## [2022-05-04] v0.4.0 155 | 156 | - 🌱 Support exports statement | 5c75137 157 | - 🐞 Apply serve | 8bc7bf9 158 | 159 | ## [2022-05-04] v0.4.4 160 | 161 | - 🐞 export default empty value | a8897c5 162 | - 🐞 duplicate export | 217110f 163 | - 🐞 skip empty require id | c56173d 164 | - 🐞 extension detect | 579dda9 165 | 166 | ## [2022-05-21] v0.4.5 167 | 168 | - e546cb7 docs: function-scope 169 | - 6d3c9d9 feat: 🚧-🐞 support function scope require() 170 | - 68add57 fix(🐞): re implementation overwrite() 171 | - abf41ed docs: v0.4.5 172 | - 9429f63 fix: check this.overwrites empty 173 | - 7075e03 fix: Bypass Pre-build 174 | - 2a66ff3 refactor: use utils.MagicString 175 | - e4173d3 feat: class MagicString 176 | - aa5b885 refactor: use utils.simpleWalk() 177 | - 94aa885 feat: simpleWalk() 178 | - 60135e4 fix: improve findtoplevelscope 179 | - 39f8505 chore: rename topLevelNode -> topScopeNode 180 | - 174b2d6 chore: update comment 181 | - aeebcab fix: filter node_modules 182 | - c5ae2c0 refactor: use utils.isCommonjs instead isCommonjs 183 | - 2a0f85a add utils.ts 184 | 185 | ## [2022-05-12] v0.4.6 186 | - 6f8c1d6 refactor: better code 187 | - 3f7e008 fix(🐞): improve MagicString.overwrite() 188 | 189 | ## [2022-05-13] v0.4.7 190 | 191 | - 4d44b15 vite-plugin-commonjs@0.4.7 192 | - a9ad902 test: v0.4.7 193 | - 095c40f chore: comments 194 | - 2dc2637 refactor: imporve generate-export 195 | 196 | ## [2022-06-16] v0.5.0 197 | 198 | - 04be6ad docs: v0.5.0 199 | - eeecebf test: v0.5.0 200 | - 0ddb4ed remove cjs-esm.ts 201 | - 1198cdc feat(v0.5.0): support dynamic require 202 | - ec74309 faet: const - KNOWN_ASSET_TYPES, KNOWN_CSS_TYPES, builtins 203 | - 4346d86 chore: comments 204 | - 9560e5b feat(v0.5.0): dynamic-require.ts 205 | 206 | ## [2022-06-20] v0.5.1 207 | 208 | - 961cbb5 docs: v0.5.1 209 | - 1584867 chore: more exact RegExp 210 | - 82301e3 refactor: `options.dynamic` instead of `options.depth` 211 | - 3b471ad chore: comments 212 | 213 | ## [2022-06-24] v0.5.2 214 | 215 | - a11aeaf test: v0.5.2 216 | - 83d9f3d docs: v0.5.2 217 | - b7e02cd refactor: move `options.onFiles` to `options.dynamic.onFiles` 218 | -------------------------------------------------------------------------------- /src/generate-import-v0.5.3.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @deprecated v0.6 3 | */ 4 | import { 5 | type Analyzed, 6 | type RequireStatement, 7 | TopScopeType, 8 | } from './analyze' 9 | 10 | /** 11 | * ``` 12 | * At present, divide `require(id: Literal)` into three cases 13 | * 目前,将 require() 分为三种情况 14 | * 15 | * ①(🎯) 16 | * In the top-level scope and can be converted to `import` directly 17 | * 在顶层作用域,并且直接转换成 import 18 | * 19 | * ②(🚧) 20 | * If the `id` in `require(id: Literal)` is a literal string, the `require` statement will be promoted to the top-level scope and become an `import` statement 21 | * 如果 require(id: Literal) 中的 id 是字面量字符串,require 语句将会被提升到顶级作用域,变成 import 语句 22 | * 23 | * ③(🚧) 24 | * If the `id` in `require(dynamic-id)` is a dynamic-id, the `require` statement will be converted to `__matchRequireRuntime` function 25 | * 如果 require(dynamic-id) 中的 id 动态 id,require 语句将会被转换成 __matchRequireRuntime 函数 26 | * ``` 27 | */ 28 | 29 | export interface ImportRecord { 30 | node: AcornNode 31 | topScopeNode?: RequireStatement['topScopeNode'] 32 | importee?: string 33 | // e.g. 34 | // source code 👉 const ast = require('acorn').parse() 35 | // ↓ 36 | // importee 👉 import * as __CJS_import__ from 'acorn' 37 | // declaration 👉 const ast = __CJS_import__.parse() 38 | declaration?: string 39 | importName?: string 40 | } 41 | 42 | export function generateImport(analyzed: Analyzed) { 43 | const imports: ImportRecord[] = [] 44 | let count = 0 45 | 46 | for (const req of analyzed.require) { 47 | const { 48 | node, 49 | ancestors, 50 | topScopeNode, 51 | dynamic, 52 | } = req 53 | 54 | // ③(🚧) 55 | // Processed in dynamic-require.ts 56 | if (dynamic === 'dynamic') continue 57 | 58 | const impt: ImportRecord = { node, topScopeNode } 59 | const importName = `__CJS__import__${count++}__` 60 | 61 | const requireIdNode = node.arguments[0] 62 | let requireId: string 63 | if (!requireIdNode) continue // Not value - require() 64 | if (requireIdNode.type === 'Literal') { 65 | requireId = requireIdNode.value 66 | } else if (dynamic === 'Literal') { 67 | requireId = requireIdNode.quasis[0].value.raw 68 | } 69 | 70 | if (!requireId!) { 71 | const codeSnippets = analyzed.code.slice(node.start, node.end) 72 | throw new Error(`The following require statement cannot be converted. 73 | -> ${codeSnippets} 74 | ${'^'.repeat(codeSnippets.length)}`) 75 | } 76 | 77 | if (topScopeNode) { 78 | // ①(🎯) 79 | 80 | // @ts-ignore 81 | switch (topScopeNode.type) { 82 | case TopScopeType.ExpressionStatement: 83 | // TODO: With members - e.g. `require().foo` 84 | impt.importee = `import '${requireId}'` 85 | break 86 | 87 | case TopScopeType.VariableDeclaration: 88 | // TODO: Multiple declaration 89 | // @ts-ignore 90 | const VariableDeclarator = topScopeNode.declarations[0] 91 | const { /* L-V */id, /* R-V */init } = VariableDeclarator as AcornNode 92 | 93 | // Left value 94 | let LV: string | { key: string, value: string }[] 95 | if (id.type === 'Identifier') { 96 | LV = id.name 97 | } else if (id.type === 'ObjectPattern') { 98 | LV = [] 99 | for (const { key, value } of id.properties) { 100 | // @ts-ignore 101 | LV.push({ key: key.name, value: value.name }) 102 | } 103 | } else { 104 | throw new Error(`Unknown VariableDeclarator.id.type(L-V): ${id.type}`) 105 | } 106 | 107 | const LV_str = (spe: string) => typeof LV === 'object' 108 | ? LV.map(e => e.key === e.value ? e.key : `${e.key} ${spe} ${e.value}`).join(', ') 109 | : '' 110 | 111 | // Right value 112 | if (init.type === 'CallExpression') { 113 | if (typeof LV === 'string') { 114 | // const acorn = require('acorn') 115 | impt.importee = `import * as ${LV} from '${requireId}'` 116 | } else { 117 | // const { parse } = require('acorn') 118 | impt.importee = `import { ${LV_str('as')} } from '${requireId}'` 119 | } 120 | } else if (init.type === 'MemberExpression') { 121 | const onlyOneMember = ancestors.find(an => an.type === 'MemberExpression')?.property.name 122 | const importDefault = onlyOneMember === 'default' 123 | if (typeof LV === 'string') { 124 | if (importDefault) { 125 | // const foo = require('foo').default 126 | impt.importee = `import ${LV} from '${requireId}'` 127 | } else { 128 | impt.importee = onlyOneMember === LV 129 | // const bar = require('foo').bar 130 | ? `import { ${LV} } from '${requireId}'` 131 | // const barAlias = require('foo').bar 132 | : `import { ${onlyOneMember} as ${LV} } from '${requireId}'` 133 | } 134 | } else { 135 | if (importDefault) { 136 | // const { member1, member2 } = require('foo').default 137 | impt.importee = `import ${importName} from '${requireId}'` 138 | } else { 139 | // const { member1, member2 } = require('foo').bar 140 | impt.importee = `import { ${onlyOneMember} as ${importName} } from '${requireId}'` 141 | } 142 | impt.declaration = `const { ${LV_str(':')} } = ${importName}` 143 | } 144 | } else { 145 | throw new Error(`Unknown VariableDeclarator.init.type(R-V): ${id.init}`) 146 | } 147 | break 148 | 149 | default: 150 | throw new Error(`Unknown TopScopeType: ${topScopeNode}`) 151 | } 152 | } else { 153 | // ②(🚧) 154 | 155 | // This is probably less accurate but is much cheaper than a full AST parse. 156 | impt.importee = `import * as ${importName} from '${requireId}'` 157 | impt.importName = `${importName}.default || ${importName}` // Loose 158 | } 159 | 160 | imports.push(impt) 161 | } 162 | 163 | return imports 164 | } 165 | -------------------------------------------------------------------------------- /commonjs.zh-CN.md: -------------------------------------------------------------------------------- 1 | ## 细说 Vite 构建 CommonJS 问题 2 | 3 | ![commonjs.jpg](./commonjs.jpg) 4 | 5 | ### esm 与 cjs 6 | 7 | esm 标准导入模块的方式,是使用写在 js 文件顶层作用域 import 语句,并且模块 id 必须是一个固定的字符串常量。这使得所有行为都是可预测的。这对于 bundler 十分的友好,甚至可以非常轻松的实现 tree-shake 功能。其次导出的模块成员必须是具名的,默认为名字为 default。 8 | 9 | cjs 标准导入模块的方式,是使用 require 函数导入模块,require 函数与普通的 js 函数没有什么区别,这就决定了 require 函数可以写在任意的作用域且导入模块 id 可以是任何的 js 变量、字符串常量、表达式。这与 import 语句有着本质的区别,也就是说 cjs(require) 的模块规范要比 esm(import) 模块灵活的多,甚至导出模块成员可以是匿名的;这样的行为差异决定了很多时候一个 cjs 模块是无法有效的转换为 esm 模块的,它们的运行行为差异非常大。 10 | 11 | esm 与 cjs 之间的相互导入/导出的转换是所有 bundler/transpiler 都会面临的一个问题,如 Vite、Webpack、esbuild、swc、tsc 等等。关于模块转换有个专有名词叫 interop。 12 | 13 | > 我之前在 B 站讲过一个视频 👉🏻 [细讲⚡️vite-plugin-commonjs(上)](https://www.bilibili.com/video/BV1gm4y1e7zK/?vd_source=44b643ef038990a11abb9118def2ef80) 14 | 15 | ### 作用域 与 同步/异步 16 | 17 | Vite(Rollup) 对于构建顶层作用域中使用 import 语句导入的模块是没有作用域概念的,代码的 bundle 规则是基于 export 导出成员的名字,它要求模块作者遵循 esm 规范。这样做理论上不会产生什么副作用,因为模块所有导出成员均在**顶层作用域**且为**同步行为**,所以这就确定了一切行为都是可预测的。 18 | 19 | 当然如果你使用 import() 函数导入模块,它更像一个普通的 js 函数,并且将不会有顶层作用域限制。导入语句可以写在**任意作用域**且模块导入永远为**异步行为**。Vite(Rollup) 默认是不会将 import() 函数导入的模块合并到 bundle.js 中,如果强行合并到 bundle.js 中可能会导致一些不可预测的副作用,例如用户在被 import() 导入的模块中的顶层作用域立即执行了一些逻辑,这可能会与用户想象中的行为不一致,因为模块会被立即执行!导致执行时机被提前,而不是 bundle.js 由上至下至执行到 import() 函数时候才被加载并执行 👉🏻 [output.inlineDynamicImports](https://github.com/rollup/rollup/blob/v4.17.1/docs/configuration-options/index.md#outputinlinedynamicimports)。 20 | 21 | ### require 与 import/import() 22 | 23 | 我们知道了模块导入的作用域,同步/异步的概念后,这将决定了 Vite(Rollup) 能否能顺利的将 require 与 import/import() 转换成功,也即 interop 问题。 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
StatementSyncAsyncScope
importGlobal
import()Global / Anywhere
require()✅ (Wrap with Promise.resolve())Global / Anywhere
53 | 54 | ### 模块互操作(interop) 55 | 56 | import 语句与 import() 函数很容易转换成 require 且无任何的副作用。 57 | 58 | ```js 59 | // Global scope 60 | 61 | import foo from './foo' 62 | ↓↓↓↓ ✅ 63 | const { default: foo } = require('./foo') 64 | 65 | import * as foo from './foo' 66 | ↓↓↓↓ ✅ 67 | const foo = require('./foo') 68 | 69 | import { bar, baz } from './foo' 70 | ↓↓↓↓ ✅ 71 | const { bar, baz } = require('./foo') 72 | 73 | function func(name) { 74 | // Function scope 75 | 76 | const foo = import(`./${name}`) 77 | ↓↓↓↓ ✅ 78 | const foo = Promise.resolve(require(`./${name}`)) 79 | } 80 | ``` 81 | 82 | require 函数换成 import 语句可能会失败! 83 | 84 | ```js 85 | // Global scope 86 | 87 | const foo = require('./foo') // 需要配合 Object.defineProperty(exports, "__esModule", { value: true }); 88 | ↓↓↓↓ 🚧 89 | import foo from './foo' 90 | 91 | const foo = require(`./${name}`) 92 | ↓↓↓↓ ❌ 93 | import foo from `./${name}` // 不支持使用变量 94 | 95 | function func(name) { 96 | // Function scope 97 | 98 | const foo = require(`./${name}`) 99 | ↓↓↓↓ ❌ 100 | const foo = import(`./${name}`) // `require` 是同步 API 101 | } 102 | ``` 103 | 104 | ### 中心化模块管理 105 | 106 | Webpack/esbuild 的 bundle 方案支持使用 require 函数导入模块并且可以**无视作用域**。他们能作到这点的主要原因都是采用了模块集中管理的策略;在 Webpack 中所有模块都被挂在到一个名为 `__webpack_modules__` 的变量上并且使用统一 `__webpack_require__` 加载函数加载,在 esbuild 中所有模块均被包裹在一个 `__commonJS` 模块管理函数中,并返回该模块的加载函数。 107 | 108 | ### Vite 的预处理 109 | 110 | Vite 中有个概念是 [Pre-Bundling](https://vitejs.dev/guide/dep-pre-bundling.html#dependency-pre-bundling),它有一个很重要的作用就是将 cjs 模块提前构建成一个 bundle.js 然后通过 esm 的形式导出模块,这很好的解决了 interop 的问题。试想一下面有一段包含条件导入模块的代码段,让我们看看预构建是如何处理它的。 111 | 112 | ```js 113 | // add.js 114 | exports.add = (a, b) => a + b 115 | 116 | // minus.js 117 | exports.minus = (a, b) => a - b 118 | 119 | // math.js 120 | exports.calc = (a, b, operate) => { 121 | const calc = operate === '+' // condition require 122 | ? require('./add').add(a, b) 123 | : require('./minus').minus(a, b) 124 | return calc(a, b) 125 | } 126 | ``` 127 | 128 | **Output a `bundle.js` file with Vite's Pre-Bundling** 129 | 130 | ```js 131 | var __commonJS = (cb, mod = { exports: {} }) => function __require2() { 132 | const cjs_wrapper = Object.values(cb)[0] // wrapper function 133 | cjs_wrapper(mod.exports, mod); // inject exports, module 134 | return mod.exports; 135 | }; 136 | 137 | // add.js 138 | var require_add = __commonJS({ 139 | "add.js"(exports, module) { 140 | exports.add = (a, b) => a + b 141 | } 142 | }) 143 | 144 | // minus.js 145 | var require_minus = __commonJS({ 146 | "minus.js"(exports, module) { 147 | exports.minus = (a, b) => a - b 148 | } 149 | }) 150 | 151 | // math.js 152 | var require_math = __commonJS({ 153 | "math.js"(exports, module) { 154 | exports.calc = (a, b, operate) => { 155 | const calc = operate === '+' // condition require 156 | ? require_add().add(a, b) 157 | : require_minus().minus(a, b) 158 | return calc(a, b) 159 | } 160 | } 161 | }); 162 | 163 | // Finally export a esmodule ✅ 164 | export default require_math(); // { calc: Function } 165 | ``` 166 | 167 | ### Vite 与 Webpack 产物 168 | 169 | 假设我们有如下两个文件分别为 add.js 与 index.js: 170 | 171 | **add.js** 172 | 173 | ```js 174 | export function add(a, b) { 175 | return a + b 176 | } 177 | ``` 178 | 179 | **index.js** 180 | 181 | ```js 182 | import { add } from './add' 183 | 184 | const sum = add(1, 2) 185 | ``` 186 | 187 | Vite(Rollup) 默认只支持 esm 格式的文件,也就是模块引用需要使用 import 语句。这个设定很好,因为它是 ECMAScript 的模块标准;同样这会带来一些天然的好处比如很容易支持 tree-shake 这是因为 import/export 语句规定所有导入/导出模块必须写在 js 文件顶层作用域,也即它们的行为可预测的。Rollup 的构建产物给人最直观的感觉就是**所见即所得**,非常符合代码书写的顺序与直觉。 188 | 189 | **Bundled with Vite** 190 | 191 | ```js 192 | // add.js 193 | function add(a, b) { 194 | return a + b 195 | } 196 | 197 | // index.js 198 | const sum = add(1, 2) 199 | ``` 200 | 201 | Webpack 的构建产物是以遵循 cjs 规范的方式组织代码,所以有 **模块中心(modules)、模块导出挂载点(module.exports)、模块加载函数(require)** 等概念。而这些概念在 Rollup 中通通没有;这是两者之间最大的区别,也即两者对模块导入/导出处理的不同。 202 | 203 | **Bundled with Webpack** 204 | 205 | ```js 206 | var __webpack_modules__ = { 207 | // index.js 208 | 0: (module, exports, __webpack_require__) => { 209 | const { add } = __webpack_require__(1) 210 | const sum = add(1 + 2) 211 | }, 212 | // add.js 213 | 1: (module, exports, __webpack_require__) => { 214 | function add(a, b) { 215 | return a + b 216 | } 217 | module.exports = { add }; 218 | }, 219 | ... 220 | } 221 | 222 | module.exports = __webpack_require__(0) 223 | ``` 224 | 225 | Webpack 首先会为所有会为所有模块提供一个 cjs 外壳代码,并且注入 模块挂载点(module, exports),模块引入函数(require)。这与 node.js 的模块加载行为完全一致,可以说 Webpack 十分适合构建 Node/Electron 应用,这个场景天然优于使用 Vite(Rollup) 构建。 226 | 227 | ### 重头戏 C/C++ 模块 228 | 229 | C/C++ 扩展是为了 Node/Electron 准备的高性能方案。社区对于构建 C/C++ 模块大部分情况下会使用 node-pre-gyp,node-gyp-build 等工具构建成为 .node 文件,然后放到固定的目录结构中,并且提供一个 bindings 工具用于加载 .node 文件,通常它们可能是这样的: 230 | 231 | ```js 232 | // node_modules/sqlite3/build/Release/node_sqlite3.node 233 | require('bindings')('node_sqlite3.node'); 234 | // node_modules/better-sqlite3/build/Release/better_sqlite3.node 235 | require('bindings')('better_sqlite3.node'); 236 | ``` 237 | 238 | C/C++ 构建的 .node 文件本质上是一个 cjs 模块,无论怎样它都不支持使用 import 语句或者 import() 函数加载,所以我们只能使用 require 函数加载它。使用 Webpack 工具构建在兼容性上具有天然的优势,因为它们都基于 cjs 格式。且 Webpack 还具有丰富的插件系统。如果使用 Webpack 将 C/C++ 模块构建成一个 bundle.js 并且以一个 esm 模块格式导出,这既能享受 Webpack 强大成熟的生态系统又能做到兼容 Vite(Rollup)。你可以想到这个方法和上面讲到的 预构建(Pre-Bundling) 思路如出一辙,事实却是如此! 239 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | import fs from 'node:fs' 2 | import path from 'node:path' 3 | import type { Plugin, ResolvedConfig } from 'vite' 4 | import type { SourceMapInput } from 'rollup' 5 | import type { Loader } from 'esbuild' 6 | import { parse as parseAst } from 'acorn' 7 | import MagicString from 'magic-string' 8 | import { 9 | DEFAULT_EXTENSIONS, 10 | KNOWN_SFC_EXTENSIONS, 11 | KNOWN_ASSET_TYPES, 12 | KNOWN_CSS_TYPES, 13 | } from 'vite-plugin-utils/constant' 14 | import { cleanUrl } from 'vite-plugin-utils/function' 15 | import { analyzer } from './analyze' 16 | import { generateImport } from './generate-import' 17 | import { generateExport } from './generate-export' 18 | import { isCommonjs } from './utils' 19 | import { DynamicRequire } from './dynamic-require' 20 | 21 | export const TAG = '[vite-plugin-commonjs]' 22 | 23 | export type ImportInteropType = 'defaultFirst' | 'namedFirst' | 'merge' 24 | 25 | export interface CommonjsOptions { 26 | filter?: (id: string) => boolean | undefined 27 | dynamic?: { 28 | /** 29 | * 1. `true` - Match all possibilities as much as possible, more like `webpack` 30 | * 2. `false` - It behaves more like `@rollup/plugin-dynamic-import-vars` 31 | * @default true 32 | */ 33 | loose?: boolean 34 | /** 35 | * If you want to exclude some files 36 | * e.g. 37 | * ```js 38 | * commonjs({ 39 | * dynamic: { 40 | * onFiles: files => files.filter(f => f !== 'types.d.ts') 41 | * } 42 | * }) 43 | * ``` 44 | */ 45 | onFiles?: (files: string[], id: string) => typeof files | undefined 46 | } 47 | advanced?: { 48 | /** 49 | * Custom import module interop behavior. 50 | * 51 | * If you want to fully customize the interop behavior, 52 | * you can pass a function and return the interop code snippet. 53 | */ 54 | importRules?: ImportInteropType | ((id: string) => ImportInteropType | string) 55 | } 56 | } 57 | 58 | export default function commonjs(options: CommonjsOptions = {}): Plugin { 59 | let config: ResolvedConfig 60 | let extensions = DEFAULT_EXTENSIONS 61 | let dynamicRequire: DynamicRequire 62 | 63 | return { 64 | name: 'vite-plugin-commonjs', 65 | configResolved(_config) { 66 | config = _config 67 | // https://github.com/vitejs/vite/blob/v4.3.0/packages/vite/src/node/config.ts#L498 68 | if (config.resolve?.extensions) extensions = config.resolve.extensions 69 | dynamicRequire = new DynamicRequire(_config, { 70 | ...options, 71 | extensions: [ 72 | ...extensions, 73 | ...KNOWN_SFC_EXTENSIONS, 74 | ...KNOWN_ASSET_TYPES.map(type => '.' + type), 75 | ...KNOWN_CSS_TYPES.map(type => '.' + type), 76 | ], 77 | }) 78 | 79 | // esbuild plugin for Vite's Pre-Bundling 80 | _config.optimizeDeps.esbuildOptions ??= {} 81 | _config.optimizeDeps.esbuildOptions.plugins ??= [] 82 | _config.optimizeDeps.esbuildOptions.plugins.push({ 83 | name: 'vite-plugin-commonjs:pre-bundle', 84 | setup(build) { 85 | build.onLoad({ filter: /.*/ }, async ({ path: id }) => { 86 | let code: string 87 | try { 88 | code = fs.readFileSync(id, 'utf8') 89 | } catch (error) { 90 | return 91 | } 92 | 93 | const result = await transformCommonjs({ 94 | options, 95 | code, 96 | id, 97 | extensions, 98 | dynamicRequire, 99 | }) 100 | 101 | if (result != null) { 102 | return { 103 | contents: result.code, 104 | loader: id.slice(id.lastIndexOf('.') + 1) as Loader, 105 | } 106 | } 107 | }) 108 | }, 109 | }) 110 | }, 111 | transform(code, id) { 112 | return transformCommonjs({ 113 | options, 114 | code, 115 | id, 116 | extensions, 117 | dynamicRequire: dynamicRequire, 118 | }) 119 | }, 120 | } 121 | } 122 | 123 | async function transformCommonjs({ 124 | options, 125 | code, 126 | id, 127 | extensions, 128 | dynamicRequire, 129 | }: { 130 | options: CommonjsOptions, 131 | code: string, 132 | id: string, 133 | extensions: string[], 134 | dynamicRequire: DynamicRequire, 135 | }): Promise<{ code: string; map: SourceMapInput; } | null | undefined> { 136 | if (!(extensions.includes(path.extname(id)) || extensions.includes(path.extname(cleanUrl(id))))) return 137 | if (!isCommonjs(code)) return 138 | 139 | const userCondition = options.filter?.(id) 140 | if (userCondition === false) return 141 | // exclude `node_modules` by default 142 | // here can only get the files in `node_modules/.vite` and `node_modules/vite/dist/client`, others will be handled by Pre-Bundling 143 | if (userCondition !== true && id.includes('node_modules')) return 144 | 145 | let ast: AcornNode 146 | try { 147 | ast = parseAst(code, { sourceType: 'module', ecmaVersion: 14 }) as AcornNode 148 | } catch (error) { 149 | // ignore as it might not be a JS file, the subsequent plugins will catch the error 150 | return null 151 | } 152 | 153 | const analyzed = analyzer(ast, code, id) 154 | const imports = generateImport(analyzed, id, options) 155 | const exportRuntime = id.includes('node_modules/.vite') 156 | // Bypass Pre-build 157 | ? null 158 | : generateExport(analyzed) 159 | const dynamics = await dynamicRequire.generateRuntime(analyzed) 160 | 161 | const hoistImports = [] 162 | const ms = new MagicString(code) 163 | 164 | // require 165 | for (const impt of imports) { 166 | const { 167 | node, 168 | importExpression, 169 | importInterop, 170 | } = impt 171 | if (importExpression != null && importInterop != null) { 172 | // TODO: Merge duplicated require id 173 | hoistImports.push(importExpression + ';') 174 | // `importInterop` with brackets see #54 175 | ms.overwrite(node.start, node.end, `(${importInterop})`) 176 | } 177 | } 178 | 179 | if (hoistImports.length) { 180 | ms.prepend([ 181 | `/* ${TAG} import-hoist-S */`, 182 | ...hoistImports, 183 | `/* ${TAG} import-hoist-E */`, 184 | ].join(' ')) 185 | } 186 | 187 | // exports 188 | if (exportRuntime) { 189 | const polyfill = [ 190 | `/* ${TAG} export-runtime-S */`, 191 | exportRuntime.polyfill, 192 | `/* ${TAG} export-runtime-E */`, 193 | ].join(' ') 194 | 195 | const _exports = [ 196 | `/* ${TAG} export-statement-S */`, 197 | exportRuntime.exportDeclaration, 198 | `/* ${TAG} export-statement-E */`, 199 | ].filter(Boolean) 200 | .join('\n') 201 | ms.prepend(polyfill).append(_exports) 202 | } 203 | 204 | // dynamic require 205 | if (dynamics) { 206 | const requires: string[] = [] 207 | const runtimes: string[] = [] 208 | let count = 0 209 | 210 | for (const dynamic of dynamics) { 211 | const { node, normally, dynamic: dymc } = dynamic 212 | if (normally) { 213 | const name = `__require2import__${count++}__` 214 | requires.push(`import * as ${name} from "${normally}";`) 215 | ms.overwrite(node.callee.start, node.callee.end, name) 216 | } else if (dymc) { 217 | requires.push(...dymc.importee.map(impt => impt + ';')) 218 | runtimes.push(dymc.runtimeFn) 219 | ms.overwrite(node.callee.start, node.callee.end, dymc.runtimeName) 220 | } 221 | } 222 | 223 | if (requires.length) { 224 | ms.prepend([ 225 | `/* ${TAG} import-require2import-S */`, 226 | ...requires, 227 | `/* ${TAG} import-require2import-E */`, 228 | ].join(' ')) 229 | } 230 | if (runtimes.length) { 231 | ms.append(/* #49 */'\n' + runtimes.join('\n')) 232 | } 233 | } 234 | 235 | if (ms.hasChanged()) { 236 | return { 237 | code: ms.toString(), 238 | map: ms.generateMap({ hires: true, source: id }), 239 | } 240 | } 241 | } 242 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@esbuild/aix-ppc64@0.21.5": 6 | version "0.21.5" 7 | resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" 8 | integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== 9 | 10 | "@esbuild/android-arm64@0.18.20": 11 | version "0.18.20" 12 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz#984b4f9c8d0377443cc2dfcef266d02244593622" 13 | integrity sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ== 14 | 15 | "@esbuild/android-arm64@0.21.5": 16 | version "0.21.5" 17 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" 18 | integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== 19 | 20 | "@esbuild/android-arm@0.18.20": 21 | version "0.18.20" 22 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.18.20.tgz#fedb265bc3a589c84cc11f810804f234947c3682" 23 | integrity sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw== 24 | 25 | "@esbuild/android-arm@0.21.5": 26 | version "0.21.5" 27 | resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" 28 | integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== 29 | 30 | "@esbuild/android-x64@0.18.20": 31 | version "0.18.20" 32 | resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz#35cf419c4cfc8babe8893d296cd990e9e9f756f2" 33 | integrity sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg== 34 | 35 | "@esbuild/android-x64@0.21.5": 36 | version "0.21.5" 37 | resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" 38 | integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== 39 | 40 | "@esbuild/darwin-arm64@0.18.20": 41 | version "0.18.20" 42 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz#08172cbeccf95fbc383399a7f39cfbddaeb0d7c1" 43 | integrity sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA== 44 | 45 | "@esbuild/darwin-arm64@0.21.5": 46 | version "0.21.5" 47 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" 48 | integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== 49 | 50 | "@esbuild/darwin-x64@0.18.20": 51 | version "0.18.20" 52 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz#d70d5790d8bf475556b67d0f8b7c5bdff053d85d" 53 | integrity sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ== 54 | 55 | "@esbuild/darwin-x64@0.21.5": 56 | version "0.21.5" 57 | resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" 58 | integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== 59 | 60 | "@esbuild/freebsd-arm64@0.18.20": 61 | version "0.18.20" 62 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz#98755cd12707f93f210e2494d6a4b51b96977f54" 63 | integrity sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw== 64 | 65 | "@esbuild/freebsd-arm64@0.21.5": 66 | version "0.21.5" 67 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" 68 | integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== 69 | 70 | "@esbuild/freebsd-x64@0.18.20": 71 | version "0.18.20" 72 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz#c1eb2bff03915f87c29cece4c1a7fa1f423b066e" 73 | integrity sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ== 74 | 75 | "@esbuild/freebsd-x64@0.21.5": 76 | version "0.21.5" 77 | resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" 78 | integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== 79 | 80 | "@esbuild/linux-arm64@0.18.20": 81 | version "0.18.20" 82 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz#bad4238bd8f4fc25b5a021280c770ab5fc3a02a0" 83 | integrity sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA== 84 | 85 | "@esbuild/linux-arm64@0.21.5": 86 | version "0.21.5" 87 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" 88 | integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== 89 | 90 | "@esbuild/linux-arm@0.18.20": 91 | version "0.18.20" 92 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz#3e617c61f33508a27150ee417543c8ab5acc73b0" 93 | integrity sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg== 94 | 95 | "@esbuild/linux-arm@0.21.5": 96 | version "0.21.5" 97 | resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" 98 | integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== 99 | 100 | "@esbuild/linux-ia32@0.18.20": 101 | version "0.18.20" 102 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz#699391cccba9aee6019b7f9892eb99219f1570a7" 103 | integrity sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA== 104 | 105 | "@esbuild/linux-ia32@0.21.5": 106 | version "0.21.5" 107 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" 108 | integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== 109 | 110 | "@esbuild/linux-loong64@0.18.20": 111 | version "0.18.20" 112 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz#e6fccb7aac178dd2ffb9860465ac89d7f23b977d" 113 | integrity sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg== 114 | 115 | "@esbuild/linux-loong64@0.21.5": 116 | version "0.21.5" 117 | resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" 118 | integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== 119 | 120 | "@esbuild/linux-mips64el@0.18.20": 121 | version "0.18.20" 122 | resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz#eeff3a937de9c2310de30622a957ad1bd9183231" 123 | integrity sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ== 124 | 125 | "@esbuild/linux-mips64el@0.21.5": 126 | version "0.21.5" 127 | resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" 128 | integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== 129 | 130 | "@esbuild/linux-ppc64@0.18.20": 131 | version "0.18.20" 132 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz#2f7156bde20b01527993e6881435ad79ba9599fb" 133 | integrity sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA== 134 | 135 | "@esbuild/linux-ppc64@0.21.5": 136 | version "0.21.5" 137 | resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" 138 | integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== 139 | 140 | "@esbuild/linux-riscv64@0.18.20": 141 | version "0.18.20" 142 | resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz#6628389f210123d8b4743045af8caa7d4ddfc7a6" 143 | integrity sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A== 144 | 145 | "@esbuild/linux-riscv64@0.21.5": 146 | version "0.21.5" 147 | resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" 148 | integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== 149 | 150 | "@esbuild/linux-s390x@0.18.20": 151 | version "0.18.20" 152 | resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz#255e81fb289b101026131858ab99fba63dcf0071" 153 | integrity sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ== 154 | 155 | "@esbuild/linux-s390x@0.21.5": 156 | version "0.21.5" 157 | resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" 158 | integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== 159 | 160 | "@esbuild/linux-x64@0.18.20": 161 | version "0.18.20" 162 | resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz#c7690b3417af318a9b6f96df3031a8865176d338" 163 | integrity sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w== 164 | 165 | "@esbuild/linux-x64@0.21.5": 166 | version "0.21.5" 167 | resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" 168 | integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== 169 | 170 | "@esbuild/netbsd-x64@0.18.20": 171 | version "0.18.20" 172 | resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz#30e8cd8a3dded63975e2df2438ca109601ebe0d1" 173 | integrity sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A== 174 | 175 | "@esbuild/netbsd-x64@0.21.5": 176 | version "0.21.5" 177 | resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" 178 | integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== 179 | 180 | "@esbuild/openbsd-x64@0.18.20": 181 | version "0.18.20" 182 | resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz#7812af31b205055874c8082ea9cf9ab0da6217ae" 183 | integrity sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg== 184 | 185 | "@esbuild/openbsd-x64@0.21.5": 186 | version "0.21.5" 187 | resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" 188 | integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== 189 | 190 | "@esbuild/sunos-x64@0.18.20": 191 | version "0.18.20" 192 | resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz#d5c275c3b4e73c9b0ecd38d1ca62c020f887ab9d" 193 | integrity sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ== 194 | 195 | "@esbuild/sunos-x64@0.21.5": 196 | version "0.21.5" 197 | resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" 198 | integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== 199 | 200 | "@esbuild/win32-arm64@0.18.20": 201 | version "0.18.20" 202 | resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz#73bc7f5a9f8a77805f357fab97f290d0e4820ac9" 203 | integrity sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg== 204 | 205 | "@esbuild/win32-arm64@0.21.5": 206 | version "0.21.5" 207 | resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" 208 | integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== 209 | 210 | "@esbuild/win32-ia32@0.18.20": 211 | version "0.18.20" 212 | resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz#ec93cbf0ef1085cc12e71e0d661d20569ff42102" 213 | integrity sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g== 214 | 215 | "@esbuild/win32-ia32@0.21.5": 216 | version "0.21.5" 217 | resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" 218 | integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== 219 | 220 | "@esbuild/win32-x64@0.18.20": 221 | version "0.18.20" 222 | resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz#786c5f41f043b07afb1af37683d7c33668858f6d" 223 | integrity sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ== 224 | 225 | "@esbuild/win32-x64@0.21.5": 226 | version "0.21.5" 227 | resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" 228 | integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== 229 | 230 | "@jridgewell/sourcemap-codec@^1.5.0": 231 | version "1.5.0" 232 | resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" 233 | integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== 234 | 235 | "@nodelib/fs.scandir@2.1.5": 236 | version "2.1.5" 237 | resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" 238 | integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== 239 | dependencies: 240 | "@nodelib/fs.stat" "2.0.5" 241 | run-parallel "^1.1.9" 242 | 243 | "@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": 244 | version "2.0.5" 245 | resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" 246 | integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== 247 | 248 | "@nodelib/fs.walk@^1.2.3": 249 | version "1.2.8" 250 | resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" 251 | integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== 252 | dependencies: 253 | "@nodelib/fs.scandir" "2.1.5" 254 | fastq "^1.6.0" 255 | 256 | "@rollup/rollup-android-arm-eabi@4.21.3": 257 | version "4.21.3" 258 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.3.tgz#155c7d82c1b36c3ad84d9adf9b3cd520cba81a0f" 259 | integrity sha512-MmKSfaB9GX+zXl6E8z4koOr/xU63AMVleLEa64v7R0QF/ZloMs5vcD1sHgM64GXXS1csaJutG+ddtzcueI/BLg== 260 | 261 | "@rollup/rollup-android-arm64@4.21.3": 262 | version "4.21.3" 263 | resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.3.tgz#b94b6fa002bd94a9cbd8f9e47e23b25e5bd113ba" 264 | integrity sha512-zrt8ecH07PE3sB4jPOggweBjJMzI1JG5xI2DIsUbkA+7K+Gkjys6eV7i9pOenNSDJH3eOr/jLb/PzqtmdwDq5g== 265 | 266 | "@rollup/rollup-darwin-arm64@4.21.3": 267 | version "4.21.3" 268 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.3.tgz#0934126cf9cbeadfe0eb7471ab5d1517e8cd8dcc" 269 | integrity sha512-P0UxIOrKNBFTQaXTxOH4RxuEBVCgEA5UTNV6Yz7z9QHnUJ7eLX9reOd/NYMO3+XZO2cco19mXTxDMXxit4R/eQ== 270 | 271 | "@rollup/rollup-darwin-x64@4.21.3": 272 | version "4.21.3" 273 | resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.3.tgz#0ce8e1e0f349778938c7c90e4bdc730640e0a13e" 274 | integrity sha512-L1M0vKGO5ASKntqtsFEjTq/fD91vAqnzeaF6sfNAy55aD+Hi2pBI5DKwCO+UNDQHWsDViJLqshxOahXyLSh3EA== 275 | 276 | "@rollup/rollup-linux-arm-gnueabihf@4.21.3": 277 | version "4.21.3" 278 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.3.tgz#5669d34775ad5d71e4f29ade99d0ff4df523afb6" 279 | integrity sha512-btVgIsCjuYFKUjopPoWiDqmoUXQDiW2A4C3Mtmp5vACm7/GnyuprqIDPNczeyR5W8rTXEbkmrJux7cJmD99D2g== 280 | 281 | "@rollup/rollup-linux-arm-musleabihf@4.21.3": 282 | version "4.21.3" 283 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.3.tgz#f6d1a0e1da4061370cb2f4244fbdd727c806dd88" 284 | integrity sha512-zmjbSphplZlau6ZTkxd3+NMtE4UKVy7U4aVFMmHcgO5CUbw17ZP6QCgyxhzGaU/wFFdTfiojjbLG3/0p9HhAqA== 285 | 286 | "@rollup/rollup-linux-arm64-gnu@4.21.3": 287 | version "4.21.3" 288 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.3.tgz#ed96a05e99743dee4d23cc4913fc6e01a0089c88" 289 | integrity sha512-nSZfcZtAnQPRZmUkUQwZq2OjQciR6tEoJaZVFvLHsj0MF6QhNMg0fQ6mUOsiCUpTqxTx0/O6gX0V/nYc7LrgPw== 290 | 291 | "@rollup/rollup-linux-arm64-musl@4.21.3": 292 | version "4.21.3" 293 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.3.tgz#057ea26eaa7e537a06ded617d23d57eab3cecb58" 294 | integrity sha512-MnvSPGO8KJXIMGlQDYfvYS3IosFN2rKsvxRpPO2l2cum+Z3exiExLwVU+GExL96pn8IP+GdH8Tz70EpBhO0sIQ== 295 | 296 | "@rollup/rollup-linux-powerpc64le-gnu@4.21.3": 297 | version "4.21.3" 298 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.3.tgz#6e6e1f9404c9bf3fbd7d51cd11cd288a9a2843aa" 299 | integrity sha512-+W+p/9QNDr2vE2AXU0qIy0qQE75E8RTwTwgqS2G5CRQ11vzq0tbnfBd6brWhS9bCRjAjepJe2fvvkvS3dno+iw== 300 | 301 | "@rollup/rollup-linux-riscv64-gnu@4.21.3": 302 | version "4.21.3" 303 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.3.tgz#eef1536a53f6e6658a2a778130e6b1a4a41cb439" 304 | integrity sha512-yXH6K6KfqGXaxHrtr+Uoy+JpNlUlI46BKVyonGiaD74ravdnF9BUNC+vV+SIuB96hUMGShhKV693rF9QDfO6nQ== 305 | 306 | "@rollup/rollup-linux-s390x-gnu@4.21.3": 307 | version "4.21.3" 308 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.3.tgz#2b28fb89ca084efaf8086f435025d96b4a966957" 309 | integrity sha512-R8cwY9wcnApN/KDYWTH4gV/ypvy9yZUHlbJvfaiXSB48JO3KpwSpjOGqO4jnGkLDSk1hgjYkTbTt6Q7uvPf8eg== 310 | 311 | "@rollup/rollup-linux-x64-gnu@4.21.3": 312 | version "4.21.3" 313 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.3.tgz#5226cde6c6b495b04a3392c1d2c572844e42f06b" 314 | integrity sha512-kZPbX/NOPh0vhS5sI+dR8L1bU2cSO9FgxwM8r7wHzGydzfSjLRCFAT87GR5U9scj2rhzN3JPYVC7NoBbl4FZ0g== 315 | 316 | "@rollup/rollup-linux-x64-musl@4.21.3": 317 | version "4.21.3" 318 | resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.3.tgz#2c2412982e6c2a00a2ecac6d548ebb02f0aa6ca4" 319 | integrity sha512-S0Yq+xA1VEH66uiMNhijsWAafffydd2X5b77eLHfRmfLsRSpbiAWiRHV6DEpz6aOToPsgid7TI9rGd6zB1rhbg== 320 | 321 | "@rollup/rollup-win32-arm64-msvc@4.21.3": 322 | version "4.21.3" 323 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.3.tgz#fbb6ef5379199e2ec0103ef32877b0985c773a55" 324 | integrity sha512-9isNzeL34yquCPyerog+IMCNxKR8XYmGd0tHSV+OVx0TmE0aJOo9uw4fZfUuk2qxobP5sug6vNdZR6u7Mw7Q+Q== 325 | 326 | "@rollup/rollup-win32-ia32-msvc@4.21.3": 327 | version "4.21.3" 328 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.3.tgz#d50e2082e147e24d87fe34abbf6246525ec3845a" 329 | integrity sha512-nMIdKnfZfzn1Vsk+RuOvl43ONTZXoAPUUxgcU0tXooqg4YrAqzfKzVenqqk2g5efWh46/D28cKFrOzDSW28gTA== 330 | 331 | "@rollup/rollup-win32-x64-msvc@4.21.3": 332 | version "4.21.3" 333 | resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.3.tgz#4115233aa1bd5a2060214f96d8511f6247093212" 334 | integrity sha512-fOvu7PCQjAj4eWDEuD8Xz5gpzFqXzGlxHZozHP4b9Jxv9APtdxL6STqztDzMLuRXEc4UpXGGhx029Xgm91QBeA== 335 | 336 | "@types/estree@1.0.5", "@types/estree@^1.0.0": 337 | version "1.0.5" 338 | resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" 339 | integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== 340 | 341 | "@types/node@^22.5.2": 342 | version "22.5.5" 343 | resolved "https://registry.yarnpkg.com/@types/node/-/node-22.5.5.tgz#52f939dd0f65fc552a4ad0b392f3c466cc5d7a44" 344 | integrity sha512-Xjs4y5UPO/CLdzpgR6GirZJx36yScjh73+2NlLlkFRSoQN8B0DpfXPdZGnvVmLRLOsqDpOfTNv7D9trgGhmOIA== 345 | dependencies: 346 | undici-types "~6.19.2" 347 | 348 | "@vitest/expect@2.1.1": 349 | version "2.1.1" 350 | resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-2.1.1.tgz#907137a86246c5328929d796d741c4e95d1ee19d" 351 | integrity sha512-YeueunS0HiHiQxk+KEOnq/QMzlUuOzbU1Go+PgAsHvvv3tUkJPm9xWt+6ITNTlzsMXUjmgm5T+U7KBPK2qQV6w== 352 | dependencies: 353 | "@vitest/spy" "2.1.1" 354 | "@vitest/utils" "2.1.1" 355 | chai "^5.1.1" 356 | tinyrainbow "^1.2.0" 357 | 358 | "@vitest/mocker@2.1.1": 359 | version "2.1.1" 360 | resolved "https://registry.yarnpkg.com/@vitest/mocker/-/mocker-2.1.1.tgz#3e37c80ac267318d4aa03c5073a017d148dc8e67" 361 | integrity sha512-LNN5VwOEdJqCmJ/2XJBywB11DLlkbY0ooDJW3uRX5cZyYCrc4PI/ePX0iQhE3BiEGiQmK4GE7Q/PqCkkaiPnrA== 362 | dependencies: 363 | "@vitest/spy" "^2.1.0-beta.1" 364 | estree-walker "^3.0.3" 365 | magic-string "^0.30.11" 366 | 367 | "@vitest/pretty-format@2.1.1", "@vitest/pretty-format@^2.1.1": 368 | version "2.1.1" 369 | resolved "https://registry.yarnpkg.com/@vitest/pretty-format/-/pretty-format-2.1.1.tgz#fea25dd4e88c3c1329fbccd1d16b1d607eb40067" 370 | integrity sha512-SjxPFOtuINDUW8/UkElJYQSFtnWX7tMksSGW0vfjxMneFqxVr8YJ979QpMbDW7g+BIiq88RAGDjf7en6rvLPPQ== 371 | dependencies: 372 | tinyrainbow "^1.2.0" 373 | 374 | "@vitest/runner@2.1.1": 375 | version "2.1.1" 376 | resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-2.1.1.tgz#f3b1fbc3c109fc44e2cceecc881344453f275559" 377 | integrity sha512-uTPuY6PWOYitIkLPidaY5L3t0JJITdGTSwBtwMjKzo5O6RCOEncz9PUN+0pDidX8kTHYjO0EwUIvhlGpnGpxmA== 378 | dependencies: 379 | "@vitest/utils" "2.1.1" 380 | pathe "^1.1.2" 381 | 382 | "@vitest/snapshot@2.1.1": 383 | version "2.1.1" 384 | resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-2.1.1.tgz#38ef23104e90231fea5540754a19d8468afbba66" 385 | integrity sha512-BnSku1WFy7r4mm96ha2FzN99AZJgpZOWrAhtQfoxjUU5YMRpq1zmHRq7a5K9/NjqonebO7iVDla+VvZS8BOWMw== 386 | dependencies: 387 | "@vitest/pretty-format" "2.1.1" 388 | magic-string "^0.30.11" 389 | pathe "^1.1.2" 390 | 391 | "@vitest/spy@2.1.1", "@vitest/spy@^2.1.0-beta.1": 392 | version "2.1.1" 393 | resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-2.1.1.tgz#20891f7421a994256ea0d739ed72f05532c78488" 394 | integrity sha512-ZM39BnZ9t/xZ/nF4UwRH5il0Sw93QnZXd9NAZGRpIgj0yvVwPpLd702s/Cx955rGaMlyBQkZJ2Ir7qyY48VZ+g== 395 | dependencies: 396 | tinyspy "^3.0.0" 397 | 398 | "@vitest/utils@2.1.1": 399 | version "2.1.1" 400 | resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-2.1.1.tgz#284d016449ecb4f8704d198d049fde8360cc136e" 401 | integrity sha512-Y6Q9TsI+qJ2CC0ZKj6VBb+T8UPz593N113nnUykqwANqhgf3QkZeHFlusgKLTqrnVHbj/XDKZcDHol+dxVT+rQ== 402 | dependencies: 403 | "@vitest/pretty-format" "2.1.1" 404 | loupe "^3.1.1" 405 | tinyrainbow "^1.2.0" 406 | 407 | acorn@^8.12.1: 408 | version "8.12.1" 409 | resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" 410 | integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== 411 | 412 | assertion-error@^2.0.1: 413 | version "2.0.1" 414 | resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-2.0.1.tgz#f641a196b335690b1070bf00b6e7593fec190bf7" 415 | integrity sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA== 416 | 417 | braces@^3.0.2: 418 | version "3.0.2" 419 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 420 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 421 | dependencies: 422 | fill-range "^7.0.1" 423 | 424 | cac@^6.7.14: 425 | version "6.7.14" 426 | resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" 427 | integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== 428 | 429 | chai@^5.1.1: 430 | version "5.1.1" 431 | resolved "https://registry.yarnpkg.com/chai/-/chai-5.1.1.tgz#f035d9792a22b481ead1c65908d14bb62ec1c82c" 432 | integrity sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA== 433 | dependencies: 434 | assertion-error "^2.0.1" 435 | check-error "^2.1.1" 436 | deep-eql "^5.0.1" 437 | loupe "^3.1.0" 438 | pathval "^2.0.0" 439 | 440 | check-error@^2.1.1: 441 | version "2.1.1" 442 | resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.1.tgz#87eb876ae71ee388fa0471fe423f494be1d96ccc" 443 | integrity sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw== 444 | 445 | data-uri-to-buffer@^4.0.0: 446 | version "4.0.1" 447 | resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" 448 | integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== 449 | 450 | debug@^4.3.6: 451 | version "4.3.7" 452 | resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" 453 | integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== 454 | dependencies: 455 | ms "^2.1.3" 456 | 457 | deep-eql@^5.0.1: 458 | version "5.0.2" 459 | resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-5.0.2.tgz#4b756d8d770a9257300825d52a2c2cff99c3a341" 460 | integrity sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q== 461 | 462 | es-module-lexer@^1.5.4: 463 | version "1.5.4" 464 | resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" 465 | integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== 466 | 467 | esbuild@^0.18.10: 468 | version "0.18.20" 469 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.18.20.tgz#4709f5a34801b43b799ab7d6d82f7284a9b7a7a6" 470 | integrity sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA== 471 | optionalDependencies: 472 | "@esbuild/android-arm" "0.18.20" 473 | "@esbuild/android-arm64" "0.18.20" 474 | "@esbuild/android-x64" "0.18.20" 475 | "@esbuild/darwin-arm64" "0.18.20" 476 | "@esbuild/darwin-x64" "0.18.20" 477 | "@esbuild/freebsd-arm64" "0.18.20" 478 | "@esbuild/freebsd-x64" "0.18.20" 479 | "@esbuild/linux-arm" "0.18.20" 480 | "@esbuild/linux-arm64" "0.18.20" 481 | "@esbuild/linux-ia32" "0.18.20" 482 | "@esbuild/linux-loong64" "0.18.20" 483 | "@esbuild/linux-mips64el" "0.18.20" 484 | "@esbuild/linux-ppc64" "0.18.20" 485 | "@esbuild/linux-riscv64" "0.18.20" 486 | "@esbuild/linux-s390x" "0.18.20" 487 | "@esbuild/linux-x64" "0.18.20" 488 | "@esbuild/netbsd-x64" "0.18.20" 489 | "@esbuild/openbsd-x64" "0.18.20" 490 | "@esbuild/sunos-x64" "0.18.20" 491 | "@esbuild/win32-arm64" "0.18.20" 492 | "@esbuild/win32-ia32" "0.18.20" 493 | "@esbuild/win32-x64" "0.18.20" 494 | 495 | esbuild@^0.21.3: 496 | version "0.21.5" 497 | resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" 498 | integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== 499 | optionalDependencies: 500 | "@esbuild/aix-ppc64" "0.21.5" 501 | "@esbuild/android-arm" "0.21.5" 502 | "@esbuild/android-arm64" "0.21.5" 503 | "@esbuild/android-x64" "0.21.5" 504 | "@esbuild/darwin-arm64" "0.21.5" 505 | "@esbuild/darwin-x64" "0.21.5" 506 | "@esbuild/freebsd-arm64" "0.21.5" 507 | "@esbuild/freebsd-x64" "0.21.5" 508 | "@esbuild/linux-arm" "0.21.5" 509 | "@esbuild/linux-arm64" "0.21.5" 510 | "@esbuild/linux-ia32" "0.21.5" 511 | "@esbuild/linux-loong64" "0.21.5" 512 | "@esbuild/linux-mips64el" "0.21.5" 513 | "@esbuild/linux-ppc64" "0.21.5" 514 | "@esbuild/linux-riscv64" "0.21.5" 515 | "@esbuild/linux-s390x" "0.21.5" 516 | "@esbuild/linux-x64" "0.21.5" 517 | "@esbuild/netbsd-x64" "0.21.5" 518 | "@esbuild/openbsd-x64" "0.21.5" 519 | "@esbuild/sunos-x64" "0.21.5" 520 | "@esbuild/win32-arm64" "0.21.5" 521 | "@esbuild/win32-ia32" "0.21.5" 522 | "@esbuild/win32-x64" "0.21.5" 523 | 524 | estree-walker@^3.0.3: 525 | version "3.0.3" 526 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d" 527 | integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g== 528 | dependencies: 529 | "@types/estree" "^1.0.0" 530 | 531 | fast-glob@^3.3.2: 532 | version "3.3.2" 533 | resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" 534 | integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== 535 | dependencies: 536 | "@nodelib/fs.stat" "^2.0.2" 537 | "@nodelib/fs.walk" "^1.2.3" 538 | glob-parent "^5.1.2" 539 | merge2 "^1.3.0" 540 | micromatch "^4.0.4" 541 | 542 | fastq@^1.6.0: 543 | version "1.13.0" 544 | resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" 545 | integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== 546 | dependencies: 547 | reusify "^1.0.4" 548 | 549 | fetch-blob@^3.1.2, fetch-blob@^3.1.4: 550 | version "3.2.0" 551 | resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" 552 | integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== 553 | dependencies: 554 | node-domexception "^1.0.0" 555 | web-streams-polyfill "^3.0.3" 556 | 557 | fill-range@^7.0.1: 558 | version "7.0.1" 559 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 560 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 561 | dependencies: 562 | to-regex-range "^5.0.1" 563 | 564 | formdata-polyfill@^4.0.10: 565 | version "4.0.10" 566 | resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" 567 | integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== 568 | dependencies: 569 | fetch-blob "^3.1.2" 570 | 571 | fsevents@~2.3.2: 572 | version "2.3.2" 573 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" 574 | integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== 575 | 576 | fsevents@~2.3.3: 577 | version "2.3.3" 578 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" 579 | integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== 580 | 581 | get-func-name@^2.0.1: 582 | version "2.0.2" 583 | resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" 584 | integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== 585 | 586 | glob-parent@^5.1.2: 587 | version "5.1.2" 588 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" 589 | integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== 590 | dependencies: 591 | is-glob "^4.0.1" 592 | 593 | is-extglob@^2.1.1: 594 | version "2.1.1" 595 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 596 | integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== 597 | 598 | is-glob@^4.0.1: 599 | version "4.0.3" 600 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" 601 | integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== 602 | dependencies: 603 | is-extglob "^2.1.1" 604 | 605 | is-number@^7.0.0: 606 | version "7.0.0" 607 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 608 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 609 | 610 | loupe@^3.1.0, loupe@^3.1.1: 611 | version "3.1.1" 612 | resolved "https://registry.yarnpkg.com/loupe/-/loupe-3.1.1.tgz#71d038d59007d890e3247c5db97c1ec5a92edc54" 613 | integrity sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw== 614 | dependencies: 615 | get-func-name "^2.0.1" 616 | 617 | magic-string@^0.30.11: 618 | version "0.30.11" 619 | resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.11.tgz#301a6f93b3e8c2cb13ac1a7a673492c0dfd12954" 620 | integrity sha512-+Wri9p0QHMy+545hKww7YAu5NyzF8iomPL/RQazugQ9+Ez4Ic3mERMd8ZTX5rfK944j+560ZJi8iAwgak1Ac7A== 621 | dependencies: 622 | "@jridgewell/sourcemap-codec" "^1.5.0" 623 | 624 | merge2@^1.3.0: 625 | version "1.4.1" 626 | resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" 627 | integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== 628 | 629 | micromatch@^4.0.4: 630 | version "4.0.5" 631 | resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" 632 | integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== 633 | dependencies: 634 | braces "^3.0.2" 635 | picomatch "^2.3.1" 636 | 637 | ms@^2.1.3: 638 | version "2.1.3" 639 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" 640 | integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== 641 | 642 | nanoid@^3.3.7: 643 | version "3.3.7" 644 | resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" 645 | integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== 646 | 647 | node-domexception@^1.0.0: 648 | version "1.0.0" 649 | resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" 650 | integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== 651 | 652 | node-fetch@^3.3.2: 653 | version "3.3.2" 654 | resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" 655 | integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== 656 | dependencies: 657 | data-uri-to-buffer "^4.0.0" 658 | fetch-blob "^3.1.4" 659 | formdata-polyfill "^4.0.10" 660 | 661 | pathe@^1.1.2: 662 | version "1.1.2" 663 | resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.2.tgz#6c4cb47a945692e48a1ddd6e4094d170516437ec" 664 | integrity sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ== 665 | 666 | pathval@^2.0.0: 667 | version "2.0.0" 668 | resolved "https://registry.yarnpkg.com/pathval/-/pathval-2.0.0.tgz#7e2550b422601d4f6b8e26f1301bc8f15a741a25" 669 | integrity sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA== 670 | 671 | picocolors@^1.1.0: 672 | version "1.1.0" 673 | resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.0.tgz#5358b76a78cde483ba5cef6a9dc9671440b27d59" 674 | integrity sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw== 675 | 676 | picomatch@^2.3.1: 677 | version "2.3.1" 678 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" 679 | integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== 680 | 681 | postcss@^8.4.27, postcss@^8.4.43: 682 | version "8.4.47" 683 | resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.47.tgz#5bf6c9a010f3e724c503bf03ef7947dcb0fea365" 684 | integrity sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ== 685 | dependencies: 686 | nanoid "^3.3.7" 687 | picocolors "^1.1.0" 688 | source-map-js "^1.2.1" 689 | 690 | queue-microtask@^1.2.2: 691 | version "1.2.3" 692 | resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" 693 | integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== 694 | 695 | reusify@^1.0.4: 696 | version "1.0.4" 697 | resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" 698 | integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== 699 | 700 | rollup@^3.27.1: 701 | version "3.29.4" 702 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-3.29.4.tgz#4d70c0f9834146df8705bfb69a9a19c9e1109981" 703 | integrity sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw== 704 | optionalDependencies: 705 | fsevents "~2.3.2" 706 | 707 | rollup@^4.20.0: 708 | version "4.21.3" 709 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.21.3.tgz#c64ba119e6aeb913798a6f7eef2780a0df5a0821" 710 | integrity sha512-7sqRtBNnEbcBtMeRVc6VRsJMmpI+JU1z9VTvW8D4gXIYQFz0aLcsE6rRkyghZkLfEgUZgVvOG7A5CVz/VW5GIA== 711 | dependencies: 712 | "@types/estree" "1.0.5" 713 | optionalDependencies: 714 | "@rollup/rollup-android-arm-eabi" "4.21.3" 715 | "@rollup/rollup-android-arm64" "4.21.3" 716 | "@rollup/rollup-darwin-arm64" "4.21.3" 717 | "@rollup/rollup-darwin-x64" "4.21.3" 718 | "@rollup/rollup-linux-arm-gnueabihf" "4.21.3" 719 | "@rollup/rollup-linux-arm-musleabihf" "4.21.3" 720 | "@rollup/rollup-linux-arm64-gnu" "4.21.3" 721 | "@rollup/rollup-linux-arm64-musl" "4.21.3" 722 | "@rollup/rollup-linux-powerpc64le-gnu" "4.21.3" 723 | "@rollup/rollup-linux-riscv64-gnu" "4.21.3" 724 | "@rollup/rollup-linux-s390x-gnu" "4.21.3" 725 | "@rollup/rollup-linux-x64-gnu" "4.21.3" 726 | "@rollup/rollup-linux-x64-musl" "4.21.3" 727 | "@rollup/rollup-win32-arm64-msvc" "4.21.3" 728 | "@rollup/rollup-win32-ia32-msvc" "4.21.3" 729 | "@rollup/rollup-win32-x64-msvc" "4.21.3" 730 | fsevents "~2.3.2" 731 | 732 | run-parallel@^1.1.9: 733 | version "1.2.0" 734 | resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" 735 | integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== 736 | dependencies: 737 | queue-microtask "^1.2.2" 738 | 739 | siginfo@^2.0.0: 740 | version "2.0.0" 741 | resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" 742 | integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== 743 | 744 | source-map-js@^1.2.1: 745 | version "1.2.1" 746 | resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" 747 | integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== 748 | 749 | stackback@0.0.2: 750 | version "0.0.2" 751 | resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" 752 | integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== 753 | 754 | std-env@^3.7.0: 755 | version "3.7.0" 756 | resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" 757 | integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== 758 | 759 | tinybench@^2.9.0: 760 | version "2.9.0" 761 | resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.9.0.tgz#103c9f8ba6d7237a47ab6dd1dcff77251863426b" 762 | integrity sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg== 763 | 764 | tinyexec@^0.3.0: 765 | version "0.3.0" 766 | resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.0.tgz#ed60cfce19c17799d4a241e06b31b0ec2bee69e6" 767 | integrity sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg== 768 | 769 | tinypool@^1.0.0: 770 | version "1.0.1" 771 | resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-1.0.1.tgz#c64233c4fac4304e109a64340178760116dbe1fe" 772 | integrity sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA== 773 | 774 | tinyrainbow@^1.2.0: 775 | version "1.2.0" 776 | resolved "https://registry.yarnpkg.com/tinyrainbow/-/tinyrainbow-1.2.0.tgz#5c57d2fc0fb3d1afd78465c33ca885d04f02abb5" 777 | integrity sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ== 778 | 779 | tinyspy@^3.0.0: 780 | version "3.0.2" 781 | resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-3.0.2.tgz#86dd3cf3d737b15adcf17d7887c84a75201df20a" 782 | integrity sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q== 783 | 784 | to-regex-range@^5.0.1: 785 | version "5.0.1" 786 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 787 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 788 | dependencies: 789 | is-number "^7.0.0" 790 | 791 | typescript@^5.6.2: 792 | version "5.6.2" 793 | resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.6.2.tgz#d1de67b6bef77c41823f822df8f0b3bcff60a5a0" 794 | integrity sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw== 795 | 796 | undici-types@~6.19.2: 797 | version "6.19.8" 798 | resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" 799 | integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== 800 | 801 | vite-node@2.1.1: 802 | version "2.1.1" 803 | resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-2.1.1.tgz#7d46f623c04dfed6df34e7127711508a3386fa1c" 804 | integrity sha512-N/mGckI1suG/5wQI35XeR9rsMsPqKXzq1CdUndzVstBj/HvyxxGctwnK6WX43NGt5L3Z5tcRf83g4TITKJhPrA== 805 | dependencies: 806 | cac "^6.7.14" 807 | debug "^4.3.6" 808 | pathe "^1.1.2" 809 | vite "^5.0.0" 810 | 811 | vite-plugin-dynamic-import@^1.6.0: 812 | version "1.6.0" 813 | resolved "https://registry.yarnpkg.com/vite-plugin-dynamic-import/-/vite-plugin-dynamic-import-1.6.0.tgz#c9680b2093fc897721fe535202acc8af77537ae4" 814 | integrity sha512-TM0sz70wfzTIo9YCxVFwS8OA9lNREsh+0vMHGSkWDTZ7bgd1Yjs5RV8EgB634l/91IsXJReg0xtmuQqP0mf+rg== 815 | dependencies: 816 | acorn "^8.12.1" 817 | es-module-lexer "^1.5.4" 818 | fast-glob "^3.3.2" 819 | magic-string "^0.30.11" 820 | 821 | vite-plugin-utils@^0.4.5: 822 | version "0.4.5" 823 | resolved "https://registry.yarnpkg.com/vite-plugin-utils/-/vite-plugin-utils-0.4.5.tgz#b6f71309b3ad36592b02ea88faf2cdbf075669ca" 824 | integrity sha512-ZkKUIsNhyDNRWhp29oL96Ys0EzU4sqnNxa/z82vTLeAODDx4i4M9SjyIkDpPjiYnqRtYdjJo+eru7DTOXQ/o9A== 825 | 826 | vite@^4.4.5: 827 | version "4.5.3" 828 | resolved "https://registry.yarnpkg.com/vite/-/vite-4.5.3.tgz#d88a4529ea58bae97294c7e2e6f0eab39a50fb1a" 829 | integrity sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg== 830 | dependencies: 831 | esbuild "^0.18.10" 832 | postcss "^8.4.27" 833 | rollup "^3.27.1" 834 | optionalDependencies: 835 | fsevents "~2.3.2" 836 | 837 | vite@^5.0.0: 838 | version "5.4.5" 839 | resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.5.tgz#e4ab27709de46ff29bd8db52b0c51606acba893b" 840 | integrity sha512-pXqR0qtb2bTwLkev4SE3r4abCNioP3GkjvIDLlzziPpXtHgiJIjuKl+1GN6ESOT3wMjG3JTeARopj2SwYaHTOA== 841 | dependencies: 842 | esbuild "^0.21.3" 843 | postcss "^8.4.43" 844 | rollup "^4.20.0" 845 | optionalDependencies: 846 | fsevents "~2.3.3" 847 | 848 | vitest@^2.1.1: 849 | version "2.1.1" 850 | resolved "https://registry.yarnpkg.com/vitest/-/vitest-2.1.1.tgz#24a6f6f5d894509f10685b82de008c507faacbb1" 851 | integrity sha512-97We7/VC0e9X5zBVkvt7SGQMGrRtn3KtySFQG5fpaMlS+l62eeXRQO633AYhSTC3z7IMebnPPNjGXVGNRFlxBA== 852 | dependencies: 853 | "@vitest/expect" "2.1.1" 854 | "@vitest/mocker" "2.1.1" 855 | "@vitest/pretty-format" "^2.1.1" 856 | "@vitest/runner" "2.1.1" 857 | "@vitest/snapshot" "2.1.1" 858 | "@vitest/spy" "2.1.1" 859 | "@vitest/utils" "2.1.1" 860 | chai "^5.1.1" 861 | debug "^4.3.6" 862 | magic-string "^0.30.11" 863 | pathe "^1.1.2" 864 | std-env "^3.7.0" 865 | tinybench "^2.9.0" 866 | tinyexec "^0.3.0" 867 | tinypool "^1.0.0" 868 | tinyrainbow "^1.2.0" 869 | vite "^5.0.0" 870 | vite-node "2.1.1" 871 | why-is-node-running "^2.3.0" 872 | 873 | web-streams-polyfill@^3.0.3: 874 | version "3.2.1" 875 | resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" 876 | integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== 877 | 878 | why-is-node-running@^2.3.0: 879 | version "2.3.0" 880 | resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.3.0.tgz#a3f69a97107f494b3cdc3bdddd883a7d65cebf04" 881 | integrity sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w== 882 | dependencies: 883 | siginfo "^2.0.0" 884 | stackback "0.0.2" 885 | --------------------------------------------------------------------------------