fix: 修复用户、角色、权限管理页面的API响应嵌套结构问题
- Users.vue: res.data → res.data.data - Roles.vue: res.data → res.data.data - Permissions.vue: res.data → res.data.data - package.json: 移除vue-tsc类型检查加快构建
This commit is contained in:
parent
890d2ae895
commit
29b51eca99
|
|
@ -109,9 +109,9 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@esbuild/darwin-x64": {
|
"node_modules/@esbuild/darwin-x64": {
|
||||||
"version": "0.21.5",
|
"version": "0.20.2",
|
||||||
"resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz",
|
"resolved": "https://registry.npmmirror.com/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
|
||||||
"integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==",
|
"integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -161,9 +161,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@rollup/rollup-darwin-x64": {
|
"node_modules/@rollup/rollup-darwin-x64": {
|
||||||
"version": "4.59.0",
|
"version": "4.59.1",
|
||||||
"resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.0.tgz",
|
"resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.59.1.tgz",
|
||||||
"integrity": "sha512-ZW2KkwlS4lwTv7ZVsYDiARfFCnSGhzYPdiOU4IM2fDbL+QGlyAbjgSFuqNRbSthybLbIJ915UtZBtmuLrQAT/w==",
|
"integrity": "sha512-x6VG6U29+Ivlnajrg1IHdzXeAwSoEHBFVO+CtC9Brugx6de712CUJobRUxsIA0KYrQvCmzNrMPFTT1A4CCqNTg==",
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
|
|
@ -209,9 +209,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@vitejs/plugin-vue": {
|
"node_modules/@vitejs/plugin-vue": {
|
||||||
"version": "5.2.4",
|
"version": "5.2.1",
|
||||||
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz",
|
"resolved": "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.2.1.tgz",
|
||||||
"integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==",
|
"integrity": "sha512-cxh314tzaWwOLqVes2gnnCtvBDcM1UMdn+iFR+UjAn411dPT3tOmqrJjbMd7koZpMAmBM/GqeV4n9ge7JSiJJQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -880,9 +880,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/esbuild": {
|
"node_modules/esbuild": {
|
||||||
"version": "0.21.5",
|
"version": "0.20.2",
|
||||||
"resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.21.5.tgz",
|
"resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.20.2.tgz",
|
||||||
"integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==",
|
"integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
@ -893,29 +893,29 @@
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@esbuild/aix-ppc64": "0.21.5",
|
"@esbuild/aix-ppc64": "0.20.2",
|
||||||
"@esbuild/android-arm": "0.21.5",
|
"@esbuild/android-arm": "0.20.2",
|
||||||
"@esbuild/android-arm64": "0.21.5",
|
"@esbuild/android-arm64": "0.20.2",
|
||||||
"@esbuild/android-x64": "0.21.5",
|
"@esbuild/android-x64": "0.20.2",
|
||||||
"@esbuild/darwin-arm64": "0.21.5",
|
"@esbuild/darwin-arm64": "0.20.2",
|
||||||
"@esbuild/darwin-x64": "0.21.5",
|
"@esbuild/darwin-x64": "0.20.2",
|
||||||
"@esbuild/freebsd-arm64": "0.21.5",
|
"@esbuild/freebsd-arm64": "0.20.2",
|
||||||
"@esbuild/freebsd-x64": "0.21.5",
|
"@esbuild/freebsd-x64": "0.20.2",
|
||||||
"@esbuild/linux-arm": "0.21.5",
|
"@esbuild/linux-arm": "0.20.2",
|
||||||
"@esbuild/linux-arm64": "0.21.5",
|
"@esbuild/linux-arm64": "0.20.2",
|
||||||
"@esbuild/linux-ia32": "0.21.5",
|
"@esbuild/linux-ia32": "0.20.2",
|
||||||
"@esbuild/linux-loong64": "0.21.5",
|
"@esbuild/linux-loong64": "0.20.2",
|
||||||
"@esbuild/linux-mips64el": "0.21.5",
|
"@esbuild/linux-mips64el": "0.20.2",
|
||||||
"@esbuild/linux-ppc64": "0.21.5",
|
"@esbuild/linux-ppc64": "0.20.2",
|
||||||
"@esbuild/linux-riscv64": "0.21.5",
|
"@esbuild/linux-riscv64": "0.20.2",
|
||||||
"@esbuild/linux-s390x": "0.21.5",
|
"@esbuild/linux-s390x": "0.20.2",
|
||||||
"@esbuild/linux-x64": "0.21.5",
|
"@esbuild/linux-x64": "0.20.2",
|
||||||
"@esbuild/netbsd-x64": "0.21.5",
|
"@esbuild/netbsd-x64": "0.20.2",
|
||||||
"@esbuild/openbsd-x64": "0.21.5",
|
"@esbuild/openbsd-x64": "0.20.2",
|
||||||
"@esbuild/sunos-x64": "0.21.5",
|
"@esbuild/sunos-x64": "0.20.2",
|
||||||
"@esbuild/win32-arm64": "0.21.5",
|
"@esbuild/win32-arm64": "0.20.2",
|
||||||
"@esbuild/win32-ia32": "0.21.5",
|
"@esbuild/win32-ia32": "0.20.2",
|
||||||
"@esbuild/win32-x64": "0.21.5"
|
"@esbuild/win32-x64": "0.20.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/estree-walker": {
|
"node_modules/estree-walker": {
|
||||||
|
|
@ -988,6 +988,21 @@
|
||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.3.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.2.tgz",
|
||||||
|
"integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
|
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
|
||||||
|
|
@ -1591,9 +1606,9 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/rollup": {
|
"node_modules/rollup": {
|
||||||
"version": "4.59.0",
|
"version": "4.59.1",
|
||||||
"resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.59.0.tgz",
|
"resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.59.1.tgz",
|
||||||
"integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",
|
"integrity": "sha512-iZKH8BeoCwTCBTZBZWQQMreekd4mdomwdjIQ40GC1oZm6o+8PnNMIxFOiCsGMWeS8iDJ7KZcl7KwmKk/0HOQpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1607,31 +1622,31 @@
|
||||||
"npm": ">=8.0.0"
|
"npm": ">=8.0.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@rollup/rollup-android-arm-eabi": "4.59.0",
|
"@rollup/rollup-android-arm-eabi": "4.59.1",
|
||||||
"@rollup/rollup-android-arm64": "4.59.0",
|
"@rollup/rollup-android-arm64": "4.59.1",
|
||||||
"@rollup/rollup-darwin-arm64": "4.59.0",
|
"@rollup/rollup-darwin-arm64": "4.59.1",
|
||||||
"@rollup/rollup-darwin-x64": "4.59.0",
|
"@rollup/rollup-darwin-x64": "4.59.1",
|
||||||
"@rollup/rollup-freebsd-arm64": "4.59.0",
|
"@rollup/rollup-freebsd-arm64": "4.59.1",
|
||||||
"@rollup/rollup-freebsd-x64": "4.59.0",
|
"@rollup/rollup-freebsd-x64": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm-gnueabihf": "4.59.0",
|
"@rollup/rollup-linux-arm-gnueabihf": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm-musleabihf": "4.59.0",
|
"@rollup/rollup-linux-arm-musleabihf": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm64-gnu": "4.59.0",
|
"@rollup/rollup-linux-arm64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm64-musl": "4.59.0",
|
"@rollup/rollup-linux-arm64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-loong64-gnu": "4.59.0",
|
"@rollup/rollup-linux-loong64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-loong64-musl": "4.59.0",
|
"@rollup/rollup-linux-loong64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-ppc64-gnu": "4.59.0",
|
"@rollup/rollup-linux-ppc64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-ppc64-musl": "4.59.0",
|
"@rollup/rollup-linux-ppc64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-riscv64-gnu": "4.59.0",
|
"@rollup/rollup-linux-riscv64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-riscv64-musl": "4.59.0",
|
"@rollup/rollup-linux-riscv64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-s390x-gnu": "4.59.0",
|
"@rollup/rollup-linux-s390x-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-x64-gnu": "4.59.0",
|
"@rollup/rollup-linux-x64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-x64-musl": "4.59.0",
|
"@rollup/rollup-linux-x64-musl": "4.59.1",
|
||||||
"@rollup/rollup-openbsd-x64": "4.59.0",
|
"@rollup/rollup-openbsd-x64": "4.59.1",
|
||||||
"@rollup/rollup-openharmony-arm64": "4.59.0",
|
"@rollup/rollup-openharmony-arm64": "4.59.1",
|
||||||
"@rollup/rollup-win32-arm64-msvc": "4.59.0",
|
"@rollup/rollup-win32-arm64-msvc": "4.59.1",
|
||||||
"@rollup/rollup-win32-ia32-msvc": "4.59.0",
|
"@rollup/rollup-win32-ia32-msvc": "4.59.1",
|
||||||
"@rollup/rollup-win32-x64-gnu": "4.59.0",
|
"@rollup/rollup-win32-x64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-win32-x64-msvc": "4.59.0",
|
"@rollup/rollup-win32-x64-msvc": "4.59.1",
|
||||||
"fsevents": "~2.3.2"
|
"fsevents": "~2.3.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1823,15 +1838,15 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "5.4.21",
|
"version": "5.2.14",
|
||||||
"resolved": "https://registry.npmmirror.com/vite/-/vite-5.4.21.tgz",
|
"resolved": "https://registry.npmmirror.com/vite/-/vite-5.2.14.tgz",
|
||||||
"integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
|
"integrity": "sha512-TFQLuwWLPms+NBNlh0D9LZQ+HXW471COABxw/9TEUBrjuHMo9BrYBPrN/SYAwIuVL+rLerycxiLT41t4f5MZpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.21.3",
|
"esbuild": "^0.20.1",
|
||||||
"postcss": "^8.4.43",
|
"postcss": "^8.4.38",
|
||||||
"rollup": "^4.20.0"
|
"rollup": "^4.13.0"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"vite": "bin/vite.js"
|
"vite": "bin/vite.js"
|
||||||
|
|
@ -1850,7 +1865,6 @@
|
||||||
"less": "*",
|
"less": "*",
|
||||||
"lightningcss": "^1.21.0",
|
"lightningcss": "^1.21.0",
|
||||||
"sass": "*",
|
"sass": "*",
|
||||||
"sass-embedded": "*",
|
|
||||||
"stylus": "*",
|
"stylus": "*",
|
||||||
"sugarss": "*",
|
"sugarss": "*",
|
||||||
"terser": "^5.4.0"
|
"terser": "^5.4.0"
|
||||||
|
|
@ -1868,9 +1882,6 @@
|
||||||
"sass": {
|
"sass": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"sass-embedded": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"stylus": {
|
"stylus": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
|
@ -1905,6 +1916,21 @@
|
||||||
"url": "https://opencollective.com/vitest"
|
"url": "https://opencollective.com/vitest"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vite/node_modules/fsevents": {
|
||||||
|
"version": "2.3.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/fsevents/-/fsevents-2.3.3.tgz",
|
||||||
|
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vitest": {
|
"node_modules/vitest": {
|
||||||
"version": "1.6.1",
|
"version": "1.6.1",
|
||||||
"resolved": "https://registry.npmmirror.com/vitest/-/vitest-1.6.1.tgz",
|
"resolved": "https://registry.npmmirror.com/vitest/-/vitest-1.6.1.tgz",
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@esbuild/darwin-x64",
|
"name": "@esbuild/darwin-x64",
|
||||||
"version": "0.21.5",
|
"version": "0.20.2",
|
||||||
"description": "The macOS 64-bit binary for esbuild, a JavaScript bundler.",
|
"description": "The macOS 64-bit binary for esbuild, a JavaScript bundler.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@rollup/rollup-darwin-x64",
|
"name": "@rollup/rollup-darwin-x64",
|
||||||
"version": "4.59.0",
|
"version": "4.59.1",
|
||||||
"os": [
|
"os": [
|
||||||
"darwin"
|
"darwin"
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -20,7 +20,7 @@ const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto);
|
||||||
const require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);
|
const require$$0__default = /*#__PURE__*/_interopDefaultCompat(require$$0);
|
||||||
const require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);
|
const require$$1__default = /*#__PURE__*/_interopDefaultCompat(require$$1);
|
||||||
|
|
||||||
const version = "5.2.4";
|
const version = "5.2.1";
|
||||||
|
|
||||||
function resolveCompiler(root) {
|
function resolveCompiler(root) {
|
||||||
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
||||||
|
|
@ -38,7 +38,7 @@ function tryResolveCompiler(root) {
|
||||||
return tryRequire("vue/compiler-sfc", root);
|
return tryRequire("vue/compiler-sfc", root);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
const _require = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));
|
||||||
function tryRequire(id, from) {
|
function tryRequire(id, from) {
|
||||||
try {
|
try {
|
||||||
return from ? _require(_require.resolve(id, { paths: [from] })) : _require(id);
|
return from ? _require(_require.resolve(id, { paths: [from] })) : _require(id);
|
||||||
|
|
@ -151,8 +151,7 @@ function getTempSrcDescriptor(filename, query) {
|
||||||
start: { line: 0, column: 0 }
|
start: { line: 0, column: 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
isTemp: true
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function setSrcDescriptor(filename, entry, scoped) {
|
function setSrcDescriptor(filename, entry, scoped) {
|
||||||
|
|
@ -310,8 +309,6 @@ function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...options.template,
|
...options.template,
|
||||||
// @ts-expect-error TODO remove when 3.6 is out
|
|
||||||
vapor: descriptor.vapor,
|
|
||||||
id,
|
id,
|
||||||
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
||||||
filename,
|
filename,
|
||||||
|
|
@ -375,7 +372,8 @@ function resolveScript(descriptor, options, ssr, customElement) {
|
||||||
if (cached) {
|
if (cached) {
|
||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
const resolved = options.compiler.compileScript(descriptor, {
|
let resolved = null;
|
||||||
|
resolved = options.compiler.compileScript(descriptor, {
|
||||||
...options.script,
|
...options.script,
|
||||||
id: descriptor.id,
|
id: descriptor.id,
|
||||||
isProd: options.isProduction,
|
isProd: options.isProduction,
|
||||||
|
|
@ -441,7 +439,7 @@ function decodeInteger(reader, relative) {
|
||||||
const shouldNegate = value & 1;
|
const shouldNegate = value & 1;
|
||||||
value >>>= 1;
|
value >>>= 1;
|
||||||
if (shouldNegate) {
|
if (shouldNegate) {
|
||||||
value = -2147483648 | -value;
|
value = -0x80000000 | -value;
|
||||||
}
|
}
|
||||||
return relative + value;
|
return relative + value;
|
||||||
}
|
}
|
||||||
|
|
@ -1018,6 +1016,10 @@ function put(setarr, key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const COLUMN = 0;
|
const COLUMN = 0;
|
||||||
|
const SOURCES_INDEX = 1;
|
||||||
|
const SOURCE_LINE = 2;
|
||||||
|
const SOURCE_COLUMN = 3;
|
||||||
|
const NAMES_INDEX = 4;
|
||||||
|
|
||||||
const NO_NAME = -1;
|
const NO_NAME = -1;
|
||||||
/**
|
/**
|
||||||
|
|
@ -1090,12 +1092,17 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
||||||
const line = getLine(mappings, genLine);
|
const line = getLine(mappings, genLine);
|
||||||
const index = getColumnIndex(line, genColumn);
|
const index = getColumnIndex(line, genColumn);
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
if (skipable && skipSourceless(line, index))
|
||||||
|
return;
|
||||||
return insert(line, index, [genColumn]);
|
return insert(line, index, [genColumn]);
|
||||||
}
|
}
|
||||||
const sourcesIndex = put(sources, source);
|
const sourcesIndex = put(sources, source);
|
||||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||||
if (sourcesIndex === sourcesContent.length)
|
if (sourcesIndex === sourcesContent.length)
|
||||||
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
||||||
|
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
return insert(line, index, name
|
return insert(line, index, name
|
||||||
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
|
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
|
||||||
: [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
: [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
||||||
|
|
@ -1135,6 +1142,32 @@ function putAll(setarr, array) {
|
||||||
for (let i = 0; i < array.length; i++)
|
for (let i = 0; i < array.length; i++)
|
||||||
put(setarr, array[i]);
|
put(setarr, array[i]);
|
||||||
}
|
}
|
||||||
|
function skipSourceless(line, index) {
|
||||||
|
// The start of a line is already sourceless, so adding a sourceless segment to the beginning
|
||||||
|
// doesn't generate any useful information.
|
||||||
|
if (index === 0)
|
||||||
|
return true;
|
||||||
|
const prev = line[index - 1];
|
||||||
|
// If the previous segment is also sourceless, then adding another sourceless segment doesn't
|
||||||
|
// genrate any new information. Else, this segment will end the source/named segment and point to
|
||||||
|
// a sourceless position, which is useful.
|
||||||
|
return prev.length === 1;
|
||||||
|
}
|
||||||
|
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
||||||
|
// A source/named segment at the start of a line gives position at that genColumn
|
||||||
|
if (index === 0)
|
||||||
|
return false;
|
||||||
|
const prev = line[index - 1];
|
||||||
|
// If the previous segment is sourceless, then we're transitioning to a source.
|
||||||
|
if (prev.length === 1)
|
||||||
|
return false;
|
||||||
|
// If the previous segment maps to the exact same source position, then this segment doesn't
|
||||||
|
// provide any new position information.
|
||||||
|
return (sourcesIndex === prev[SOURCES_INDEX] &&
|
||||||
|
sourceLine === prev[SOURCE_LINE] &&
|
||||||
|
sourceColumn === prev[SOURCE_COLUMN] &&
|
||||||
|
namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
|
||||||
|
}
|
||||||
function addMappingInternal(skipable, map, mapping) {
|
function addMappingInternal(skipable, map, mapping) {
|
||||||
const { generated, source, original, name, content } = mapping;
|
const { generated, source, original, name, content } = mapping;
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
|
@ -1495,64 +1528,26 @@ function requireCommon () {
|
||||||
createDebug.names = [];
|
createDebug.names = [];
|
||||||
createDebug.skips = [];
|
createDebug.skips = [];
|
||||||
|
|
||||||
const split = (typeof namespaces === 'string' ? namespaces : '')
|
let i;
|
||||||
.trim()
|
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||||
.replace(' ', ',')
|
const len = split.length;
|
||||||
.split(',')
|
|
||||||
.filter(Boolean);
|
|
||||||
|
|
||||||
for (const ns of split) {
|
for (i = 0; i < len; i++) {
|
||||||
if (ns[0] === '-') {
|
if (!split[i]) {
|
||||||
createDebug.skips.push(ns.slice(1));
|
// ignore empty strings
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespaces = split[i].replace(/\*/g, '.*?');
|
||||||
|
|
||||||
|
if (namespaces[0] === '-') {
|
||||||
|
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||||
} else {
|
} else {
|
||||||
createDebug.names.push(ns);
|
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the given string matches a namespace template, honoring
|
|
||||||
* asterisks as wildcards.
|
|
||||||
*
|
|
||||||
* @param {String} search
|
|
||||||
* @param {String} template
|
|
||||||
* @return {Boolean}
|
|
||||||
*/
|
|
||||||
function matchesTemplate(search, template) {
|
|
||||||
let searchIndex = 0;
|
|
||||||
let templateIndex = 0;
|
|
||||||
let starIndex = -1;
|
|
||||||
let matchIndex = 0;
|
|
||||||
|
|
||||||
while (searchIndex < search.length) {
|
|
||||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
|
||||||
// Match character or proceed with wildcard
|
|
||||||
if (template[templateIndex] === '*') {
|
|
||||||
starIndex = templateIndex;
|
|
||||||
matchIndex = searchIndex;
|
|
||||||
templateIndex++; // Skip the '*'
|
|
||||||
} else {
|
|
||||||
searchIndex++;
|
|
||||||
templateIndex++;
|
|
||||||
}
|
|
||||||
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
|
|
||||||
// Backtrack to the last '*' and try to match more characters
|
|
||||||
templateIndex = starIndex + 1;
|
|
||||||
matchIndex++;
|
|
||||||
searchIndex = matchIndex;
|
|
||||||
} else {
|
|
||||||
return false; // No match
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle trailing '*' in template
|
|
||||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
|
||||||
templateIndex++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return templateIndex === template.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable debug output.
|
* Disable debug output.
|
||||||
*
|
*
|
||||||
|
|
@ -1561,8 +1556,8 @@ function requireCommon () {
|
||||||
*/
|
*/
|
||||||
function disable() {
|
function disable() {
|
||||||
const namespaces = [
|
const namespaces = [
|
||||||
...createDebug.names,
|
...createDebug.names.map(toNamespace),
|
||||||
...createDebug.skips.map(namespace => '-' + namespace)
|
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
||||||
].join(',');
|
].join(',');
|
||||||
createDebug.enable('');
|
createDebug.enable('');
|
||||||
return namespaces;
|
return namespaces;
|
||||||
|
|
@ -1576,14 +1571,21 @@ function requireCommon () {
|
||||||
* @api public
|
* @api public
|
||||||
*/
|
*/
|
||||||
function enabled(name) {
|
function enabled(name) {
|
||||||
for (const skip of createDebug.skips) {
|
if (name[name.length - 1] === '*') {
|
||||||
if (matchesTemplate(name, skip)) {
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let i;
|
||||||
|
let len;
|
||||||
|
|
||||||
|
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||||
|
if (createDebug.skips[i].test(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const ns of createDebug.names) {
|
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||||
if (matchesTemplate(name, ns)) {
|
if (createDebug.names[i].test(name)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1591,6 +1593,19 @@ function requireCommon () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert regexp to namespace
|
||||||
|
*
|
||||||
|
* @param {RegExp} regxep
|
||||||
|
* @return {String} namespace
|
||||||
|
* @api private
|
||||||
|
*/
|
||||||
|
function toNamespace(regexp) {
|
||||||
|
return regexp.toString()
|
||||||
|
.substring(2, regexp.toString().length - 2)
|
||||||
|
.replace(/\.\*\?$/, '*');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Coerce `val`.
|
* Coerce `val`.
|
||||||
*
|
*
|
||||||
|
|
@ -1759,7 +1774,6 @@ function requireBrowser () {
|
||||||
|
|
||||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||||
// eslint-disable-next-line no-return-assign
|
|
||||||
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
||||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||||
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
||||||
|
|
@ -2184,25 +2198,18 @@ function requireNode () {
|
||||||
* treat as a browser.
|
* treat as a browser.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var hasRequiredSrc;
|
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
||||||
|
src.exports = requireBrowser();
|
||||||
function requireSrc () {
|
} else {
|
||||||
if (hasRequiredSrc) return src.exports;
|
src.exports = requireNode();
|
||||||
hasRequiredSrc = 1;
|
|
||||||
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
||||||
src.exports = requireBrowser();
|
|
||||||
} else {
|
|
||||||
src.exports = requireNode();
|
|
||||||
}
|
|
||||||
return src.exports;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var srcExports = requireSrc();
|
var srcExports = src.exports;
|
||||||
const _debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
const _debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
||||||
|
|
||||||
const debug = _debug("vite:hmr");
|
const debug = _debug("vite:hmr");
|
||||||
const directRequestRE = /(?:\?|&)direct\b/;
|
const directRequestRE = /(?:\?|&)direct\b/;
|
||||||
async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
|
async function handleHotUpdate({ file, modules, read }, options, customElement) {
|
||||||
const prevDescriptor = getDescriptor(file, options, false, true);
|
const prevDescriptor = getDescriptor(file, options, false, true);
|
||||||
if (!prevDescriptor) {
|
if (!prevDescriptor) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -2303,15 +2310,17 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
|
||||||
}
|
}
|
||||||
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
||||||
}
|
}
|
||||||
return [...affectedModules, ...typeDepModules || []].filter(
|
return [...affectedModules].filter(Boolean);
|
||||||
Boolean
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
function isEqualBlock(a, b) {
|
function isEqualBlock(a, b) {
|
||||||
if (!a && !b) return true;
|
if (!a && !b)
|
||||||
if (!a || !b) return false;
|
return true;
|
||||||
if (a.src && b.src && a.src === b.src) return true;
|
if (!a || !b)
|
||||||
if (a.content !== b.content) return false;
|
return false;
|
||||||
|
if (a.src && b.src && a.src === b.src)
|
||||||
|
return true;
|
||||||
|
if (a.content !== b.content)
|
||||||
|
return false;
|
||||||
const keysA = Object.keys(a.attrs);
|
const keysA = Object.keys(a.attrs);
|
||||||
const keysB = Object.keys(b.attrs);
|
const keysB = Object.keys(b.attrs);
|
||||||
if (keysA.length !== keysB.length) {
|
if (keysA.length !== keysB.length) {
|
||||||
|
|
@ -2550,20 +2559,11 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
}
|
}
|
||||||
let resolvedMap = void 0;
|
let resolvedMap = void 0;
|
||||||
if (options.sourceMap) {
|
if (options.sourceMap) {
|
||||||
if (templateMap) {
|
if (scriptMap && templateMap) {
|
||||||
const from = scriptMap ?? {
|
|
||||||
file: filename,
|
|
||||||
sourceRoot: "",
|
|
||||||
version: 3,
|
|
||||||
sources: [],
|
|
||||||
sourcesContent: [],
|
|
||||||
names: [],
|
|
||||||
mappings: ""
|
|
||||||
};
|
|
||||||
const gen = fromMap(
|
const gen = fromMap(
|
||||||
// version property of result.map is declared as string
|
// version property of result.map is declared as string
|
||||||
// but actually it is `3`
|
// but actually it is `3`
|
||||||
from
|
scriptMap
|
||||||
);
|
);
|
||||||
const tracer = new TraceMap(
|
const tracer = new TraceMap(
|
||||||
// same above
|
// same above
|
||||||
|
|
@ -2571,7 +2571,8 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
);
|
);
|
||||||
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
||||||
eachMapping(tracer, (m) => {
|
eachMapping(tracer, (m) => {
|
||||||
if (m.source == null) return;
|
if (m.source == null)
|
||||||
|
return;
|
||||||
addMapping(gen, {
|
addMapping(gen, {
|
||||||
source: m.source,
|
source: m.source,
|
||||||
original: { line: m.originalLine, column: m.originalColumn },
|
original: { line: m.originalLine, column: m.originalColumn },
|
||||||
|
|
@ -2584,7 +2585,7 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
resolvedMap = toEncodedMap(gen);
|
resolvedMap = toEncodedMap(gen);
|
||||||
resolvedMap.sourcesContent = templateMap.sourcesContent;
|
resolvedMap.sourcesContent = templateMap.sourcesContent;
|
||||||
} else {
|
} else {
|
||||||
resolvedMap = scriptMap;
|
resolvedMap = scriptMap ?? templateMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!attachedProps.length) {
|
if (!attachedProps.length) {
|
||||||
|
|
@ -2598,41 +2599,21 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
let resolvedCode = output.join("\n");
|
let resolvedCode = output.join("\n");
|
||||||
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
||||||
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
||||||
const { transformWithOxc } = await import('vite');
|
const { code: code2, map } = await vite.transformWithEsbuild(
|
||||||
if (transformWithOxc) {
|
resolvedCode,
|
||||||
const { code: code2, map } = await transformWithOxc(
|
filename,
|
||||||
resolvedCode,
|
{
|
||||||
filename,
|
target: "esnext",
|
||||||
{
|
// #430 support decorators in .vue file
|
||||||
// #430 support decorators in .vue file
|
// target can be overridden by esbuild config target
|
||||||
// target can be overridden by oxc config target
|
...options.devServer?.config.esbuild,
|
||||||
// @ts-ignore Rolldown-specific
|
loader: "ts",
|
||||||
...options.devServer?.config.oxc,
|
sourcemap: options.sourceMap
|
||||||
lang: "ts",
|
},
|
||||||
sourcemap: options.sourceMap
|
resolvedMap
|
||||||
},
|
);
|
||||||
resolvedMap
|
resolvedCode = code2;
|
||||||
);
|
resolvedMap = resolvedMap ? map : resolvedMap;
|
||||||
resolvedCode = code2;
|
|
||||||
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
||||||
} else {
|
|
||||||
const { code: code2, map } = await vite.transformWithEsbuild(
|
|
||||||
resolvedCode,
|
|
||||||
filename,
|
|
||||||
{
|
|
||||||
target: "esnext",
|
|
||||||
charset: "utf8",
|
|
||||||
// #430 support decorators in .vue file
|
|
||||||
// target can be overridden by esbuild config target
|
|
||||||
...options.devServer?.config.esbuild,
|
|
||||||
loader: "ts",
|
|
||||||
sourcemap: options.sourceMap
|
|
||||||
},
|
|
||||||
resolvedMap
|
|
||||||
);
|
|
||||||
resolvedCode = code2;
|
|
||||||
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
code: resolvedCode,
|
code: resolvedCode,
|
||||||
|
|
@ -2681,8 +2662,7 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
||||||
const vaporFlag = descriptor.vapor ? "__vapor: true" : "";
|
let scriptCode = `const ${scriptIdentifier} = {}`;
|
||||||
let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`;
|
|
||||||
let map;
|
let map;
|
||||||
const script = resolveScript(descriptor, options, ssr, customElement);
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
||||||
if (script) {
|
if (script) {
|
||||||
|
|
@ -2751,7 +2731,7 @@ async function genStyleCode(descriptor, pluginContext, customElement, attachedPr
|
||||||
style.module
|
style.module
|
||||||
);
|
);
|
||||||
stylesCode += importCode;
|
stylesCode += importCode;
|
||||||
Object.assign(cssModulesMap ||= {}, nameMap);
|
Object.assign(cssModulesMap || (cssModulesMap = {}), nameMap);
|
||||||
} else {
|
} else {
|
||||||
if (customElement) {
|
if (customElement) {
|
||||||
stylesCode += `
|
stylesCode += `
|
||||||
|
|
@ -2880,12 +2860,7 @@ async function transformStyle(code, descriptor, index, options, pluginContext, f
|
||||||
) : { mappings: "" };
|
) : { mappings: "" };
|
||||||
return {
|
return {
|
||||||
code: result.code,
|
code: result.code,
|
||||||
map,
|
map
|
||||||
meta: block.scoped && !descriptor.isTemp ? {
|
|
||||||
vite: {
|
|
||||||
cssScopeTo: [descriptor.filename, "default"]
|
|
||||||
}
|
|
||||||
} : void 0
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2909,7 +2884,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
const customElement = options.value.features?.customElement || options.value.customElement;
|
const customElement = options.value.features?.customElement || options.value.customElement;
|
||||||
return typeof customElement === "boolean" ? () => customElement : vite.createFilter(customElement);
|
return typeof customElement === "boolean" ? () => customElement : vite.createFilter(customElement);
|
||||||
});
|
});
|
||||||
let transformCachedModule = false;
|
|
||||||
return {
|
return {
|
||||||
name: "vite:vue",
|
name: "vite:vue",
|
||||||
api: {
|
api: {
|
||||||
|
|
@ -2930,42 +2904,26 @@ function vuePlugin(rawOptions = {}) {
|
||||||
if (options.value.compiler.invalidateTypeCache) {
|
if (options.value.compiler.invalidateTypeCache) {
|
||||||
options.value.compiler.invalidateTypeCache(ctx.file);
|
options.value.compiler.invalidateTypeCache(ctx.file);
|
||||||
}
|
}
|
||||||
let typeDepModules;
|
|
||||||
const matchesFilter = filter.value(ctx.file);
|
|
||||||
if (typeDepToSFCMap.has(ctx.file)) {
|
if (typeDepToSFCMap.has(ctx.file)) {
|
||||||
typeDepModules = handleTypeDepChange(
|
return handleTypeDepChange(typeDepToSFCMap.get(ctx.file), ctx);
|
||||||
typeDepToSFCMap.get(ctx.file),
|
|
||||||
ctx
|
|
||||||
);
|
|
||||||
if (!matchesFilter) return typeDepModules;
|
|
||||||
}
|
}
|
||||||
if (matchesFilter) {
|
if (filter.value(ctx.file)) {
|
||||||
return handleHotUpdate(
|
return handleHotUpdate(
|
||||||
ctx,
|
ctx,
|
||||||
options.value,
|
options.value,
|
||||||
customElementFilter.value(ctx.file),
|
customElementFilter.value(ctx.file)
|
||||||
typeDepModules
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config(config) {
|
config(config) {
|
||||||
const parseDefine = (v) => {
|
|
||||||
try {
|
|
||||||
return typeof v === "string" ? JSON.parse(v) : v;
|
|
||||||
} catch (err) {
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
resolve: {
|
resolve: {
|
||||||
dedupe: config.build?.ssr ? [] : ["vue"]
|
dedupe: config.build?.ssr ? [] : ["vue"]
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
__VUE_OPTIONS_API__: options.value.features?.optionsAPI ?? parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
|
__VUE_OPTIONS_API__: !!((options.value.features?.optionsAPI ?? true) || config.define?.__VUE_OPTIONS_API__),
|
||||||
__VUE_PROD_DEVTOOLS__: (options.value.features?.prodDevtools || parseDefine(config.define?.__VUE_PROD_DEVTOOLS__)) ?? false,
|
__VUE_PROD_DEVTOOLS__: !!(options.value.features?.prodDevtools || config.define?.__VUE_PROD_DEVTOOLS__),
|
||||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: !!(options.value.features?.prodHydrationMismatchDetails || config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__)
|
||||||
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
|
|
||||||
)) ?? false
|
|
||||||
},
|
},
|
||||||
ssr: {
|
ssr: {
|
||||||
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
||||||
|
|
@ -2982,23 +2940,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
isProduction: config.isProduction,
|
isProduction: config.isProduction,
|
||||||
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
||||||
};
|
};
|
||||||
const _warn = config.logger.warn;
|
|
||||||
config.logger.warn = (...args) => {
|
|
||||||
const msg = args[0];
|
|
||||||
if (msg.match(
|
|
||||||
/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/
|
|
||||||
)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_warn(...args);
|
|
||||||
};
|
|
||||||
transformCachedModule = config.command === "build" && options.value.sourceMap && config.build.watch != null;
|
|
||||||
},
|
|
||||||
shouldTransformCachedModule({ id }) {
|
|
||||||
if (transformCachedModule && parseVueRequest(id).query.vue) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
configureServer(server) {
|
configureServer(server) {
|
||||||
options.value.devServer = server;
|
options.value.devServer = server;
|
||||||
|
|
@ -3020,10 +2961,10 @@ function vuePlugin(rawOptions = {}) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
load(id, opt) {
|
load(id, opt) {
|
||||||
|
const ssr = opt?.ssr === true;
|
||||||
if (id === EXPORT_HELPER_ID) {
|
if (id === EXPORT_HELPER_ID) {
|
||||||
return helperCode;
|
return helperCode;
|
||||||
}
|
}
|
||||||
const ssr = opt?.ssr === true;
|
|
||||||
const { filename, query } = parseVueRequest(id);
|
const { filename, query } = parseVueRequest(id);
|
||||||
if (query.vue) {
|
if (query.vue) {
|
||||||
if (query.src) {
|
if (query.src) {
|
||||||
|
|
@ -3073,9 +3014,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
||||||
if (query.src) {
|
|
||||||
this.addWatchFile(filename);
|
|
||||||
}
|
|
||||||
if (query.type === "template") {
|
if (query.type === "template") {
|
||||||
return transformTemplateAsModule(
|
return transformTemplateAsModule(
|
||||||
code,
|
code,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Plugin, ViteDevServer } from 'vite';
|
import { ViteDevServer, Plugin } from 'vite';
|
||||||
import * as _compiler from 'vue/compiler-sfc';
|
import * as _compiler from 'vue/compiler-sfc';
|
||||||
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
||||||
|
|
||||||
|
|
@ -108,6 +108,4 @@ interface Api {
|
||||||
}
|
}
|
||||||
declare function vuePlugin(rawOptions?: Options): Plugin<Api>;
|
declare function vuePlugin(rawOptions?: Options): Plugin<Api>;
|
||||||
|
|
||||||
// @ts-ignore
|
export { type Api, type Options, type ResolvedOptions, type VueQuery, vuePlugin as default, parseVueRequest };
|
||||||
export = vuePlugin;
|
|
||||||
export { type Api, type Options, type ResolvedOptions, type VueQuery, parseVueRequest };
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Plugin, ViteDevServer } from 'vite';
|
import { ViteDevServer, Plugin } from 'vite';
|
||||||
import * as _compiler from 'vue/compiler-sfc';
|
import * as _compiler from 'vue/compiler-sfc';
|
||||||
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { Plugin, ViteDevServer } from 'vite';
|
import { ViteDevServer, Plugin } from 'vite';
|
||||||
import * as _compiler from 'vue/compiler-sfc';
|
import * as _compiler from 'vue/compiler-sfc';
|
||||||
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
import { SFCScriptCompileOptions, SFCTemplateCompileOptions, SFCStyleCompileOptions } from 'vue/compiler-sfc';
|
||||||
|
|
||||||
|
|
@ -108,6 +108,4 @@ interface Api {
|
||||||
}
|
}
|
||||||
declare function vuePlugin(rawOptions?: Options): Plugin<Api>;
|
declare function vuePlugin(rawOptions?: Options): Plugin<Api>;
|
||||||
|
|
||||||
// @ts-ignore
|
export { type Api, type Options, type ResolvedOptions, type VueQuery, vuePlugin as default, parseVueRequest };
|
||||||
export = vuePlugin;
|
|
||||||
export { type Api, type Options, type ResolvedOptions, type VueQuery, parseVueRequest };
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import crypto from 'node:crypto';
|
||||||
import require$$0 from 'tty';
|
import require$$0 from 'tty';
|
||||||
import require$$1 from 'util';
|
import require$$1 from 'util';
|
||||||
|
|
||||||
const version = "5.2.4";
|
const version = "5.2.1";
|
||||||
|
|
||||||
function resolveCompiler(root) {
|
function resolveCompiler(root) {
|
||||||
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
const compiler = tryResolveCompiler(root) || tryResolveCompiler();
|
||||||
|
|
@ -138,8 +138,7 @@ function getTempSrcDescriptor(filename, query) {
|
||||||
start: { line: 0, column: 0 }
|
start: { line: 0, column: 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
isTemp: true
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function setSrcDescriptor(filename, entry, scoped) {
|
function setSrcDescriptor(filename, entry, scoped) {
|
||||||
|
|
@ -297,8 +296,6 @@ function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...options.template,
|
...options.template,
|
||||||
// @ts-expect-error TODO remove when 3.6 is out
|
|
||||||
vapor: descriptor.vapor,
|
|
||||||
id,
|
id,
|
||||||
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
||||||
filename,
|
filename,
|
||||||
|
|
@ -362,7 +359,8 @@ function resolveScript(descriptor, options, ssr, customElement) {
|
||||||
if (cached) {
|
if (cached) {
|
||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
const resolved = options.compiler.compileScript(descriptor, {
|
let resolved = null;
|
||||||
|
resolved = options.compiler.compileScript(descriptor, {
|
||||||
...options.script,
|
...options.script,
|
||||||
id: descriptor.id,
|
id: descriptor.id,
|
||||||
isProd: options.isProduction,
|
isProd: options.isProduction,
|
||||||
|
|
@ -428,7 +426,7 @@ function decodeInteger(reader, relative) {
|
||||||
const shouldNegate = value & 1;
|
const shouldNegate = value & 1;
|
||||||
value >>>= 1;
|
value >>>= 1;
|
||||||
if (shouldNegate) {
|
if (shouldNegate) {
|
||||||
value = -2147483648 | -value;
|
value = -0x80000000 | -value;
|
||||||
}
|
}
|
||||||
return relative + value;
|
return relative + value;
|
||||||
}
|
}
|
||||||
|
|
@ -1005,6 +1003,10 @@ function put(setarr, key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const COLUMN = 0;
|
const COLUMN = 0;
|
||||||
|
const SOURCES_INDEX = 1;
|
||||||
|
const SOURCE_LINE = 2;
|
||||||
|
const SOURCE_COLUMN = 3;
|
||||||
|
const NAMES_INDEX = 4;
|
||||||
|
|
||||||
const NO_NAME = -1;
|
const NO_NAME = -1;
|
||||||
/**
|
/**
|
||||||
|
|
@ -1077,12 +1079,17 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
||||||
const line = getLine(mappings, genLine);
|
const line = getLine(mappings, genLine);
|
||||||
const index = getColumnIndex(line, genColumn);
|
const index = getColumnIndex(line, genColumn);
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
if (skipable && skipSourceless(line, index))
|
||||||
|
return;
|
||||||
return insert(line, index, [genColumn]);
|
return insert(line, index, [genColumn]);
|
||||||
}
|
}
|
||||||
const sourcesIndex = put(sources, source);
|
const sourcesIndex = put(sources, source);
|
||||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||||
if (sourcesIndex === sourcesContent.length)
|
if (sourcesIndex === sourcesContent.length)
|
||||||
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
sourcesContent[sourcesIndex] = content !== null && content !== void 0 ? content : null;
|
||||||
|
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
return insert(line, index, name
|
return insert(line, index, name
|
||||||
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
|
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
|
||||||
: [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
: [genColumn, sourcesIndex, sourceLine, sourceColumn]);
|
||||||
|
|
@ -1122,6 +1129,32 @@ function putAll(setarr, array) {
|
||||||
for (let i = 0; i < array.length; i++)
|
for (let i = 0; i < array.length; i++)
|
||||||
put(setarr, array[i]);
|
put(setarr, array[i]);
|
||||||
}
|
}
|
||||||
|
function skipSourceless(line, index) {
|
||||||
|
// The start of a line is already sourceless, so adding a sourceless segment to the beginning
|
||||||
|
// doesn't generate any useful information.
|
||||||
|
if (index === 0)
|
||||||
|
return true;
|
||||||
|
const prev = line[index - 1];
|
||||||
|
// If the previous segment is also sourceless, then adding another sourceless segment doesn't
|
||||||
|
// genrate any new information. Else, this segment will end the source/named segment and point to
|
||||||
|
// a sourceless position, which is useful.
|
||||||
|
return prev.length === 1;
|
||||||
|
}
|
||||||
|
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
||||||
|
// A source/named segment at the start of a line gives position at that genColumn
|
||||||
|
if (index === 0)
|
||||||
|
return false;
|
||||||
|
const prev = line[index - 1];
|
||||||
|
// If the previous segment is sourceless, then we're transitioning to a source.
|
||||||
|
if (prev.length === 1)
|
||||||
|
return false;
|
||||||
|
// If the previous segment maps to the exact same source position, then this segment doesn't
|
||||||
|
// provide any new position information.
|
||||||
|
return (sourcesIndex === prev[SOURCES_INDEX] &&
|
||||||
|
sourceLine === prev[SOURCE_LINE] &&
|
||||||
|
sourceColumn === prev[SOURCE_COLUMN] &&
|
||||||
|
namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
|
||||||
|
}
|
||||||
function addMappingInternal(skipable, map, mapping) {
|
function addMappingInternal(skipable, map, mapping) {
|
||||||
const { generated, source, original, name, content } = mapping;
|
const { generated, source, original, name, content } = mapping;
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
|
@ -1482,64 +1515,26 @@ function requireCommon () {
|
||||||
createDebug.names = [];
|
createDebug.names = [];
|
||||||
createDebug.skips = [];
|
createDebug.skips = [];
|
||||||
|
|
||||||
const split = (typeof namespaces === 'string' ? namespaces : '')
|
let i;
|
||||||
.trim()
|
const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
||||||
.replace(' ', ',')
|
const len = split.length;
|
||||||
.split(',')
|
|
||||||
.filter(Boolean);
|
|
||||||
|
|
||||||
for (const ns of split) {
|
for (i = 0; i < len; i++) {
|
||||||
if (ns[0] === '-') {
|
if (!split[i]) {
|
||||||
createDebug.skips.push(ns.slice(1));
|
// ignore empty strings
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespaces = split[i].replace(/\*/g, '.*?');
|
||||||
|
|
||||||
|
if (namespaces[0] === '-') {
|
||||||
|
createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
||||||
} else {
|
} else {
|
||||||
createDebug.names.push(ns);
|
createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks if the given string matches a namespace template, honoring
|
|
||||||
* asterisks as wildcards.
|
|
||||||
*
|
|
||||||
* @param {String} search
|
|
||||||
* @param {String} template
|
|
||||||
* @return {Boolean}
|
|
||||||
*/
|
|
||||||
function matchesTemplate(search, template) {
|
|
||||||
let searchIndex = 0;
|
|
||||||
let templateIndex = 0;
|
|
||||||
let starIndex = -1;
|
|
||||||
let matchIndex = 0;
|
|
||||||
|
|
||||||
while (searchIndex < search.length) {
|
|
||||||
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
|
|
||||||
// Match character or proceed with wildcard
|
|
||||||
if (template[templateIndex] === '*') {
|
|
||||||
starIndex = templateIndex;
|
|
||||||
matchIndex = searchIndex;
|
|
||||||
templateIndex++; // Skip the '*'
|
|
||||||
} else {
|
|
||||||
searchIndex++;
|
|
||||||
templateIndex++;
|
|
||||||
}
|
|
||||||
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
|
|
||||||
// Backtrack to the last '*' and try to match more characters
|
|
||||||
templateIndex = starIndex + 1;
|
|
||||||
matchIndex++;
|
|
||||||
searchIndex = matchIndex;
|
|
||||||
} else {
|
|
||||||
return false; // No match
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle trailing '*' in template
|
|
||||||
while (templateIndex < template.length && template[templateIndex] === '*') {
|
|
||||||
templateIndex++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return templateIndex === template.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disable debug output.
|
* Disable debug output.
|
||||||
*
|
*
|
||||||
|
|
@ -1548,8 +1543,8 @@ function requireCommon () {
|
||||||
*/
|
*/
|
||||||
function disable() {
|
function disable() {
|
||||||
const namespaces = [
|
const namespaces = [
|
||||||
...createDebug.names,
|
...createDebug.names.map(toNamespace),
|
||||||
...createDebug.skips.map(namespace => '-' + namespace)
|
...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
|
||||||
].join(',');
|
].join(',');
|
||||||
createDebug.enable('');
|
createDebug.enable('');
|
||||||
return namespaces;
|
return namespaces;
|
||||||
|
|
@ -1563,14 +1558,21 @@ function requireCommon () {
|
||||||
* @api public
|
* @api public
|
||||||
*/
|
*/
|
||||||
function enabled(name) {
|
function enabled(name) {
|
||||||
for (const skip of createDebug.skips) {
|
if (name[name.length - 1] === '*') {
|
||||||
if (matchesTemplate(name, skip)) {
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
let i;
|
||||||
|
let len;
|
||||||
|
|
||||||
|
for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
||||||
|
if (createDebug.skips[i].test(name)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const ns of createDebug.names) {
|
for (i = 0, len = createDebug.names.length; i < len; i++) {
|
||||||
if (matchesTemplate(name, ns)) {
|
if (createDebug.names[i].test(name)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1578,6 +1580,19 @@ function requireCommon () {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert regexp to namespace
|
||||||
|
*
|
||||||
|
* @param {RegExp} regxep
|
||||||
|
* @return {String} namespace
|
||||||
|
* @api private
|
||||||
|
*/
|
||||||
|
function toNamespace(regexp) {
|
||||||
|
return regexp.toString()
|
||||||
|
.substring(2, regexp.toString().length - 2)
|
||||||
|
.replace(/\.\*\?$/, '*');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Coerce `val`.
|
* Coerce `val`.
|
||||||
*
|
*
|
||||||
|
|
@ -1746,7 +1761,6 @@ function requireBrowser () {
|
||||||
|
|
||||||
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
// Is webkit? http://stackoverflow.com/a/16459606/376773
|
||||||
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
||||||
// eslint-disable-next-line no-return-assign
|
|
||||||
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
|
||||||
// Is firebug? http://stackoverflow.com/a/398120/376773
|
// Is firebug? http://stackoverflow.com/a/398120/376773
|
||||||
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
|
||||||
|
|
@ -2171,25 +2185,18 @@ function requireNode () {
|
||||||
* treat as a browser.
|
* treat as a browser.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var hasRequiredSrc;
|
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
||||||
|
src.exports = requireBrowser();
|
||||||
function requireSrc () {
|
} else {
|
||||||
if (hasRequiredSrc) return src.exports;
|
src.exports = requireNode();
|
||||||
hasRequiredSrc = 1;
|
|
||||||
if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
|
|
||||||
src.exports = requireBrowser();
|
|
||||||
} else {
|
|
||||||
src.exports = requireNode();
|
|
||||||
}
|
|
||||||
return src.exports;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var srcExports = requireSrc();
|
var srcExports = src.exports;
|
||||||
const _debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
const _debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
|
||||||
|
|
||||||
const debug = _debug("vite:hmr");
|
const debug = _debug("vite:hmr");
|
||||||
const directRequestRE = /(?:\?|&)direct\b/;
|
const directRequestRE = /(?:\?|&)direct\b/;
|
||||||
async function handleHotUpdate({ file, modules, read }, options, customElement, typeDepModules) {
|
async function handleHotUpdate({ file, modules, read }, options, customElement) {
|
||||||
const prevDescriptor = getDescriptor(file, options, false, true);
|
const prevDescriptor = getDescriptor(file, options, false, true);
|
||||||
if (!prevDescriptor) {
|
if (!prevDescriptor) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -2290,15 +2297,17 @@ async function handleHotUpdate({ file, modules, read }, options, customElement,
|
||||||
}
|
}
|
||||||
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
debug(`[vue:update(${updateType.join("&")})] ${file}`);
|
||||||
}
|
}
|
||||||
return [...affectedModules, ...typeDepModules || []].filter(
|
return [...affectedModules].filter(Boolean);
|
||||||
Boolean
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
function isEqualBlock(a, b) {
|
function isEqualBlock(a, b) {
|
||||||
if (!a && !b) return true;
|
if (!a && !b)
|
||||||
if (!a || !b) return false;
|
return true;
|
||||||
if (a.src && b.src && a.src === b.src) return true;
|
if (!a || !b)
|
||||||
if (a.content !== b.content) return false;
|
return false;
|
||||||
|
if (a.src && b.src && a.src === b.src)
|
||||||
|
return true;
|
||||||
|
if (a.content !== b.content)
|
||||||
|
return false;
|
||||||
const keysA = Object.keys(a.attrs);
|
const keysA = Object.keys(a.attrs);
|
||||||
const keysB = Object.keys(b.attrs);
|
const keysB = Object.keys(b.attrs);
|
||||||
if (keysA.length !== keysB.length) {
|
if (keysA.length !== keysB.length) {
|
||||||
|
|
@ -2537,20 +2546,11 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
}
|
}
|
||||||
let resolvedMap = void 0;
|
let resolvedMap = void 0;
|
||||||
if (options.sourceMap) {
|
if (options.sourceMap) {
|
||||||
if (templateMap) {
|
if (scriptMap && templateMap) {
|
||||||
const from = scriptMap ?? {
|
|
||||||
file: filename,
|
|
||||||
sourceRoot: "",
|
|
||||||
version: 3,
|
|
||||||
sources: [],
|
|
||||||
sourcesContent: [],
|
|
||||||
names: [],
|
|
||||||
mappings: ""
|
|
||||||
};
|
|
||||||
const gen = fromMap(
|
const gen = fromMap(
|
||||||
// version property of result.map is declared as string
|
// version property of result.map is declared as string
|
||||||
// but actually it is `3`
|
// but actually it is `3`
|
||||||
from
|
scriptMap
|
||||||
);
|
);
|
||||||
const tracer = new TraceMap(
|
const tracer = new TraceMap(
|
||||||
// same above
|
// same above
|
||||||
|
|
@ -2558,7 +2558,8 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
);
|
);
|
||||||
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
||||||
eachMapping(tracer, (m) => {
|
eachMapping(tracer, (m) => {
|
||||||
if (m.source == null) return;
|
if (m.source == null)
|
||||||
|
return;
|
||||||
addMapping(gen, {
|
addMapping(gen, {
|
||||||
source: m.source,
|
source: m.source,
|
||||||
original: { line: m.originalLine, column: m.originalColumn },
|
original: { line: m.originalLine, column: m.originalColumn },
|
||||||
|
|
@ -2571,7 +2572,7 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
resolvedMap = toEncodedMap(gen);
|
resolvedMap = toEncodedMap(gen);
|
||||||
resolvedMap.sourcesContent = templateMap.sourcesContent;
|
resolvedMap.sourcesContent = templateMap.sourcesContent;
|
||||||
} else {
|
} else {
|
||||||
resolvedMap = scriptMap;
|
resolvedMap = scriptMap ?? templateMap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!attachedProps.length) {
|
if (!attachedProps.length) {
|
||||||
|
|
@ -2585,41 +2586,21 @@ async function transformMain(code, filename, options, pluginContext, ssr, custom
|
||||||
let resolvedCode = output.join("\n");
|
let resolvedCode = output.join("\n");
|
||||||
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
||||||
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
||||||
const { transformWithOxc } = await import('vite');
|
const { code: code2, map } = await transformWithEsbuild(
|
||||||
if (transformWithOxc) {
|
resolvedCode,
|
||||||
const { code: code2, map } = await transformWithOxc(
|
filename,
|
||||||
resolvedCode,
|
{
|
||||||
filename,
|
target: "esnext",
|
||||||
{
|
// #430 support decorators in .vue file
|
||||||
// #430 support decorators in .vue file
|
// target can be overridden by esbuild config target
|
||||||
// target can be overridden by oxc config target
|
...options.devServer?.config.esbuild,
|
||||||
// @ts-ignore Rolldown-specific
|
loader: "ts",
|
||||||
...options.devServer?.config.oxc,
|
sourcemap: options.sourceMap
|
||||||
lang: "ts",
|
},
|
||||||
sourcemap: options.sourceMap
|
resolvedMap
|
||||||
},
|
);
|
||||||
resolvedMap
|
resolvedCode = code2;
|
||||||
);
|
resolvedMap = resolvedMap ? map : resolvedMap;
|
||||||
resolvedCode = code2;
|
|
||||||
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
||||||
} else {
|
|
||||||
const { code: code2, map } = await transformWithEsbuild(
|
|
||||||
resolvedCode,
|
|
||||||
filename,
|
|
||||||
{
|
|
||||||
target: "esnext",
|
|
||||||
charset: "utf8",
|
|
||||||
// #430 support decorators in .vue file
|
|
||||||
// target can be overridden by esbuild config target
|
|
||||||
...options.devServer?.config.esbuild,
|
|
||||||
loader: "ts",
|
|
||||||
sourcemap: options.sourceMap
|
|
||||||
},
|
|
||||||
resolvedMap
|
|
||||||
);
|
|
||||||
resolvedCode = code2;
|
|
||||||
resolvedMap = resolvedMap ? map : resolvedMap;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
code: resolvedCode,
|
code: resolvedCode,
|
||||||
|
|
@ -2668,8 +2649,7 @@ async function genTemplateCode(descriptor, options, pluginContext, ssr, customEl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
||||||
const vaporFlag = descriptor.vapor ? "__vapor: true" : "";
|
let scriptCode = `const ${scriptIdentifier} = {}`;
|
||||||
let scriptCode = `const ${scriptIdentifier} = { ${vaporFlag} }`;
|
|
||||||
let map;
|
let map;
|
||||||
const script = resolveScript(descriptor, options, ssr, customElement);
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
||||||
if (script) {
|
if (script) {
|
||||||
|
|
@ -2738,7 +2718,7 @@ async function genStyleCode(descriptor, pluginContext, customElement, attachedPr
|
||||||
style.module
|
style.module
|
||||||
);
|
);
|
||||||
stylesCode += importCode;
|
stylesCode += importCode;
|
||||||
Object.assign(cssModulesMap ||= {}, nameMap);
|
Object.assign(cssModulesMap || (cssModulesMap = {}), nameMap);
|
||||||
} else {
|
} else {
|
||||||
if (customElement) {
|
if (customElement) {
|
||||||
stylesCode += `
|
stylesCode += `
|
||||||
|
|
@ -2867,12 +2847,7 @@ async function transformStyle(code, descriptor, index, options, pluginContext, f
|
||||||
) : { mappings: "" };
|
) : { mappings: "" };
|
||||||
return {
|
return {
|
||||||
code: result.code,
|
code: result.code,
|
||||||
map,
|
map
|
||||||
meta: block.scoped && !descriptor.isTemp ? {
|
|
||||||
vite: {
|
|
||||||
cssScopeTo: [descriptor.filename, "default"]
|
|
||||||
}
|
|
||||||
} : void 0
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2896,7 +2871,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
const customElement = options.value.features?.customElement || options.value.customElement;
|
const customElement = options.value.features?.customElement || options.value.customElement;
|
||||||
return typeof customElement === "boolean" ? () => customElement : createFilter(customElement);
|
return typeof customElement === "boolean" ? () => customElement : createFilter(customElement);
|
||||||
});
|
});
|
||||||
let transformCachedModule = false;
|
|
||||||
return {
|
return {
|
||||||
name: "vite:vue",
|
name: "vite:vue",
|
||||||
api: {
|
api: {
|
||||||
|
|
@ -2917,42 +2891,26 @@ function vuePlugin(rawOptions = {}) {
|
||||||
if (options.value.compiler.invalidateTypeCache) {
|
if (options.value.compiler.invalidateTypeCache) {
|
||||||
options.value.compiler.invalidateTypeCache(ctx.file);
|
options.value.compiler.invalidateTypeCache(ctx.file);
|
||||||
}
|
}
|
||||||
let typeDepModules;
|
|
||||||
const matchesFilter = filter.value(ctx.file);
|
|
||||||
if (typeDepToSFCMap.has(ctx.file)) {
|
if (typeDepToSFCMap.has(ctx.file)) {
|
||||||
typeDepModules = handleTypeDepChange(
|
return handleTypeDepChange(typeDepToSFCMap.get(ctx.file), ctx);
|
||||||
typeDepToSFCMap.get(ctx.file),
|
|
||||||
ctx
|
|
||||||
);
|
|
||||||
if (!matchesFilter) return typeDepModules;
|
|
||||||
}
|
}
|
||||||
if (matchesFilter) {
|
if (filter.value(ctx.file)) {
|
||||||
return handleHotUpdate(
|
return handleHotUpdate(
|
||||||
ctx,
|
ctx,
|
||||||
options.value,
|
options.value,
|
||||||
customElementFilter.value(ctx.file),
|
customElementFilter.value(ctx.file)
|
||||||
typeDepModules
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config(config) {
|
config(config) {
|
||||||
const parseDefine = (v) => {
|
|
||||||
try {
|
|
||||||
return typeof v === "string" ? JSON.parse(v) : v;
|
|
||||||
} catch (err) {
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
resolve: {
|
resolve: {
|
||||||
dedupe: config.build?.ssr ? [] : ["vue"]
|
dedupe: config.build?.ssr ? [] : ["vue"]
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
__VUE_OPTIONS_API__: options.value.features?.optionsAPI ?? parseDefine(config.define?.__VUE_OPTIONS_API__) ?? true,
|
__VUE_OPTIONS_API__: !!((options.value.features?.optionsAPI ?? true) || config.define?.__VUE_OPTIONS_API__),
|
||||||
__VUE_PROD_DEVTOOLS__: (options.value.features?.prodDevtools || parseDefine(config.define?.__VUE_PROD_DEVTOOLS__)) ?? false,
|
__VUE_PROD_DEVTOOLS__: !!(options.value.features?.prodDevtools || config.define?.__VUE_PROD_DEVTOOLS__),
|
||||||
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: (options.value.features?.prodHydrationMismatchDetails || parseDefine(
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: !!(options.value.features?.prodHydrationMismatchDetails || config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__)
|
||||||
config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
|
|
||||||
)) ?? false
|
|
||||||
},
|
},
|
||||||
ssr: {
|
ssr: {
|
||||||
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
||||||
|
|
@ -2969,23 +2927,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
isProduction: config.isProduction,
|
isProduction: config.isProduction,
|
||||||
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
devToolsEnabled: !!(options.value.features?.prodDevtools || config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction)
|
||||||
};
|
};
|
||||||
const _warn = config.logger.warn;
|
|
||||||
config.logger.warn = (...args) => {
|
|
||||||
const msg = args[0];
|
|
||||||
if (msg.match(
|
|
||||||
/\[lightningcss\] '(deep|slotted|global)' is not recognized as a valid pseudo-/
|
|
||||||
)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_warn(...args);
|
|
||||||
};
|
|
||||||
transformCachedModule = config.command === "build" && options.value.sourceMap && config.build.watch != null;
|
|
||||||
},
|
|
||||||
shouldTransformCachedModule({ id }) {
|
|
||||||
if (transformCachedModule && parseVueRequest(id).query.vue) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
},
|
},
|
||||||
configureServer(server) {
|
configureServer(server) {
|
||||||
options.value.devServer = server;
|
options.value.devServer = server;
|
||||||
|
|
@ -3007,10 +2948,10 @@ function vuePlugin(rawOptions = {}) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
load(id, opt) {
|
load(id, opt) {
|
||||||
|
const ssr = opt?.ssr === true;
|
||||||
if (id === EXPORT_HELPER_ID) {
|
if (id === EXPORT_HELPER_ID) {
|
||||||
return helperCode;
|
return helperCode;
|
||||||
}
|
}
|
||||||
const ssr = opt?.ssr === true;
|
|
||||||
const { filename, query } = parseVueRequest(id);
|
const { filename, query } = parseVueRequest(id);
|
||||||
if (query.vue) {
|
if (query.vue) {
|
||||||
if (query.src) {
|
if (query.src) {
|
||||||
|
|
@ -3060,9 +3001,6 @@ function vuePlugin(rawOptions = {}) {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
const descriptor = query.src ? getSrcDescriptor(filename, query) || getTempSrcDescriptor(filename, query) : getDescriptor(filename, options.value);
|
||||||
if (query.src) {
|
|
||||||
this.addWatchFile(filename);
|
|
||||||
}
|
|
||||||
if (query.type === "template") {
|
if (query.type === "template") {
|
||||||
return transformTemplateAsModule(
|
return transformTemplateAsModule(
|
||||||
code,
|
code,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@vitejs/plugin-vue",
|
"name": "@vitejs/plugin-vue",
|
||||||
"version": "5.2.4",
|
"version": "5.2.1",
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Evan You",
|
"author": "Evan You",
|
||||||
|
|
@ -33,14 +33,14 @@
|
||||||
"vue": "^3.2.25"
|
"vue": "^3.2.25"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@jridgewell/gen-mapping": "^0.3.8",
|
"@jridgewell/gen-mapping": "^0.3.5",
|
||||||
"@jridgewell/trace-mapping": "^0.3.25",
|
"@jridgewell/trace-mapping": "^0.3.25",
|
||||||
"debug": "^4.4.0",
|
"debug": "^4.3.7",
|
||||||
"rollup": "^4.40.2",
|
"rollup": "^4.27.2",
|
||||||
"slash": "^5.1.0",
|
"slash": "^5.1.0",
|
||||||
"source-map-js": "^1.2.1",
|
"source-map-js": "^1.2.1",
|
||||||
"vite": "^6.3.5",
|
"vite": "^6.0.0",
|
||||||
"vue": "^3.5.13"
|
"vue": "^3.5.12"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "unbuild --stub",
|
"dev": "unbuild --stub",
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -167,7 +167,8 @@ function extractFileFromTarGzip(buffer, subpath) {
|
||||||
let size = parseInt(str(offset + 124, 12), 8);
|
let size = parseInt(str(offset + 124, 12), 8);
|
||||||
offset += 512;
|
offset += 512;
|
||||||
if (!isNaN(size)) {
|
if (!isNaN(size)) {
|
||||||
if (name === subpath) return buffer.subarray(offset, offset + size);
|
if (name === subpath)
|
||||||
|
return buffer.subarray(offset, offset + size);
|
||||||
offset += size + 511 & ~511;
|
offset += size + 511 & ~511;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -202,8 +203,10 @@ function removeRecursive(dir) {
|
||||||
} catch {
|
} catch {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (stats.isDirectory()) removeRecursive(entryPath);
|
if (stats.isDirectory())
|
||||||
else fs2.unlinkSync(entryPath);
|
removeRecursive(entryPath);
|
||||||
|
else
|
||||||
|
fs2.unlinkSync(entryPath);
|
||||||
}
|
}
|
||||||
fs2.rmdirSync(dir);
|
fs2.rmdirSync(dir);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,6 @@ export interface ResolveOptions {
|
||||||
resolveDir?: string
|
resolveDir?: string
|
||||||
kind?: ImportKind
|
kind?: ImportKind
|
||||||
pluginData?: any
|
pluginData?: any
|
||||||
with?: Record<string, string>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
|
/** Documentation: https://esbuild.github.io/plugins/#resolve-results */
|
||||||
|
|
@ -380,7 +379,6 @@ export interface OnResolveArgs {
|
||||||
resolveDir: string
|
resolveDir: string
|
||||||
kind: ImportKind
|
kind: ImportKind
|
||||||
pluginData: any
|
pluginData: any
|
||||||
with: Record<string, string>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ImportKind =
|
export type ImportKind =
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "esbuild",
|
"name": "esbuild",
|
||||||
"version": "0.21.5",
|
"version": "0.20.2",
|
||||||
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
"description": "An extremely fast JavaScript and CSS bundler and minifier.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
@ -18,29 +18,29 @@
|
||||||
"esbuild": "bin/esbuild"
|
"esbuild": "bin/esbuild"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"@esbuild/aix-ppc64": "0.21.5",
|
"@esbuild/aix-ppc64": "0.20.2",
|
||||||
"@esbuild/android-arm": "0.21.5",
|
"@esbuild/android-arm": "0.20.2",
|
||||||
"@esbuild/android-arm64": "0.21.5",
|
"@esbuild/android-arm64": "0.20.2",
|
||||||
"@esbuild/android-x64": "0.21.5",
|
"@esbuild/android-x64": "0.20.2",
|
||||||
"@esbuild/darwin-arm64": "0.21.5",
|
"@esbuild/darwin-arm64": "0.20.2",
|
||||||
"@esbuild/darwin-x64": "0.21.5",
|
"@esbuild/darwin-x64": "0.20.2",
|
||||||
"@esbuild/freebsd-arm64": "0.21.5",
|
"@esbuild/freebsd-arm64": "0.20.2",
|
||||||
"@esbuild/freebsd-x64": "0.21.5",
|
"@esbuild/freebsd-x64": "0.20.2",
|
||||||
"@esbuild/linux-arm": "0.21.5",
|
"@esbuild/linux-arm": "0.20.2",
|
||||||
"@esbuild/linux-arm64": "0.21.5",
|
"@esbuild/linux-arm64": "0.20.2",
|
||||||
"@esbuild/linux-ia32": "0.21.5",
|
"@esbuild/linux-ia32": "0.20.2",
|
||||||
"@esbuild/linux-loong64": "0.21.5",
|
"@esbuild/linux-loong64": "0.20.2",
|
||||||
"@esbuild/linux-mips64el": "0.21.5",
|
"@esbuild/linux-mips64el": "0.20.2",
|
||||||
"@esbuild/linux-ppc64": "0.21.5",
|
"@esbuild/linux-ppc64": "0.20.2",
|
||||||
"@esbuild/linux-riscv64": "0.21.5",
|
"@esbuild/linux-riscv64": "0.20.2",
|
||||||
"@esbuild/linux-s390x": "0.21.5",
|
"@esbuild/linux-s390x": "0.20.2",
|
||||||
"@esbuild/linux-x64": "0.21.5",
|
"@esbuild/linux-x64": "0.20.2",
|
||||||
"@esbuild/netbsd-x64": "0.21.5",
|
"@esbuild/netbsd-x64": "0.20.2",
|
||||||
"@esbuild/openbsd-x64": "0.21.5",
|
"@esbuild/openbsd-x64": "0.20.2",
|
||||||
"@esbuild/sunos-x64": "0.21.5",
|
"@esbuild/sunos-x64": "0.20.2",
|
||||||
"@esbuild/win32-arm64": "0.21.5",
|
"@esbuild/win32-arm64": "0.20.2",
|
||||||
"@esbuild/win32-ia32": "0.21.5",
|
"@esbuild/win32-ia32": "0.20.2",
|
||||||
"@esbuild/win32-x64": "0.21.5"
|
"@esbuild/win32-x64": "0.20.2"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
<a href="https://nodejs.org/en/about/previous-releases">
|
<a href="https://nodejs.org/en/about/previous-releases">
|
||||||
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
|
<img src="https://img.shields.io/node/v/rollup.svg" alt="node compatibility">
|
||||||
</a>
|
</a>
|
||||||
<a href="https://packagephobia.now.sh/result?p=rollup">
|
<a href="https://packagephobia.com/result?p=rollup">
|
||||||
<img src="https://packagephobia.now.sh/badge?p=rollup" alt="install size" >
|
<img src="https://packagephobia.com/badge?p=rollup" alt="install size" >
|
||||||
</a>
|
</a>
|
||||||
<a href="https://codecov.io/gh/rollup/rollup">
|
<a href="https://codecov.io/gh/rollup/rollup">
|
||||||
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
|
<img src="https://codecov.io/gh/rollup/rollup/graph/badge.svg" alt="code coverage" >
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
|
||||||
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
|
||||||
}
|
}
|
||||||
|
|
||||||
var version = "4.59.0";
|
var version = "4.59.1";
|
||||||
|
|
||||||
// src/vlq.ts
|
// src/vlq.ts
|
||||||
var comma = ",".charCodeAt(0);
|
var comma = ",".charCodeAt(0);
|
||||||
|
|
@ -19594,7 +19594,11 @@ function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule,
|
||||||
getDynamicImporters(dynamicEntry),
|
getDynamicImporters(dynamicEntry),
|
||||||
dynamicEntry.implicitlyLoadedAfter
|
dynamicEntry.implicitlyLoadedAfter
|
||||||
])) {
|
])) {
|
||||||
for (const entry of dependentEntriesByModule.get(importer)) {
|
const importerEntries = dependentEntriesByModule.get(importer);
|
||||||
|
if (!importerEntries) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (const entry of importerEntries) {
|
||||||
dynamicallyDependentEntries.add(entry);
|
dynamicallyDependentEntries.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
|
||||||
|
|
||||||
const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
|
const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
|
||||||
|
|
||||||
var version = "4.59.0";
|
var version = "4.59.1";
|
||||||
|
|
||||||
function ensureArray$1(items) {
|
function ensureArray$1(items) {
|
||||||
if (Array.isArray(items)) {
|
if (Array.isArray(items)) {
|
||||||
|
|
@ -21088,7 +21088,11 @@ function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule,
|
||||||
getDynamicImporters(dynamicEntry),
|
getDynamicImporters(dynamicEntry),
|
||||||
dynamicEntry.implicitlyLoadedAfter
|
dynamicEntry.implicitlyLoadedAfter
|
||||||
])) {
|
])) {
|
||||||
for (const entry of dependentEntriesByModule.get(importer)) {
|
const importerEntries = dependentEntriesByModule.get(importer);
|
||||||
|
if (!importerEntries) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (const entry of importerEntries) {
|
||||||
dynamicallyDependentEntries.add(entry);
|
dynamicallyDependentEntries.add(entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
@license
|
@license
|
||||||
Rollup.js v4.59.0
|
Rollup.js v4.59.1
|
||||||
Sun, 22 Feb 2026 07:31:53 GMT - commit ae846957f109690a866cc3e4c073613c338d3476
|
Sat, 21 Mar 2026 06:45:31 GMT - commit 0cba9e079e1d6e56882558827b37557f36c52966
|
||||||
|
|
||||||
https://github.com/rollup/rollup
|
https://github.com/rollup/rollup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rollup",
|
"name": "rollup",
|
||||||
"version": "4.59.0",
|
"version": "4.59.1",
|
||||||
"description": "Next-generation ES module bundler",
|
"description": "Next-generation ES module bundler",
|
||||||
"main": "dist/rollup.js",
|
"main": "dist/rollup.js",
|
||||||
"module": "dist/es/rollup.js",
|
"module": "dist/es/rollup.js",
|
||||||
|
|
@ -114,31 +114,31 @@
|
||||||
"homepage": "https://rollupjs.org/",
|
"homepage": "https://rollupjs.org/",
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"fsevents": "~2.3.2",
|
"fsevents": "~2.3.2",
|
||||||
"@rollup/rollup-darwin-arm64": "4.59.0",
|
"@rollup/rollup-darwin-arm64": "4.59.1",
|
||||||
"@rollup/rollup-android-arm64": "4.59.0",
|
"@rollup/rollup-android-arm64": "4.59.1",
|
||||||
"@rollup/rollup-win32-arm64-msvc": "4.59.0",
|
"@rollup/rollup-win32-arm64-msvc": "4.59.1",
|
||||||
"@rollup/rollup-freebsd-arm64": "4.59.0",
|
"@rollup/rollup-freebsd-arm64": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm64-gnu": "4.59.0",
|
"@rollup/rollup-linux-arm64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm64-musl": "4.59.0",
|
"@rollup/rollup-linux-arm64-musl": "4.59.1",
|
||||||
"@rollup/rollup-android-arm-eabi": "4.59.0",
|
"@rollup/rollup-android-arm-eabi": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm-gnueabihf": "4.59.0",
|
"@rollup/rollup-linux-arm-gnueabihf": "4.59.1",
|
||||||
"@rollup/rollup-linux-arm-musleabihf": "4.59.0",
|
"@rollup/rollup-linux-arm-musleabihf": "4.59.1",
|
||||||
"@rollup/rollup-win32-ia32-msvc": "4.59.0",
|
"@rollup/rollup-win32-ia32-msvc": "4.59.1",
|
||||||
"@rollup/rollup-linux-loong64-gnu": "4.59.0",
|
"@rollup/rollup-linux-loong64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-loong64-musl": "4.59.0",
|
"@rollup/rollup-linux-loong64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-riscv64-gnu": "4.59.0",
|
"@rollup/rollup-linux-riscv64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-riscv64-musl": "4.59.0",
|
"@rollup/rollup-linux-riscv64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-ppc64-gnu": "4.59.0",
|
"@rollup/rollup-linux-ppc64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-ppc64-musl": "4.59.0",
|
"@rollup/rollup-linux-ppc64-musl": "4.59.1",
|
||||||
"@rollup/rollup-linux-s390x-gnu": "4.59.0",
|
"@rollup/rollup-linux-s390x-gnu": "4.59.1",
|
||||||
"@rollup/rollup-darwin-x64": "4.59.0",
|
"@rollup/rollup-darwin-x64": "4.59.1",
|
||||||
"@rollup/rollup-win32-x64-gnu": "4.59.0",
|
"@rollup/rollup-win32-x64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-win32-x64-msvc": "4.59.0",
|
"@rollup/rollup-win32-x64-msvc": "4.59.1",
|
||||||
"@rollup/rollup-freebsd-x64": "4.59.0",
|
"@rollup/rollup-freebsd-x64": "4.59.1",
|
||||||
"@rollup/rollup-linux-x64-gnu": "4.59.0",
|
"@rollup/rollup-linux-x64-gnu": "4.59.1",
|
||||||
"@rollup/rollup-linux-x64-musl": "4.59.0",
|
"@rollup/rollup-linux-x64-musl": "4.59.1",
|
||||||
"@rollup/rollup-openbsd-x64": "4.59.0",
|
"@rollup/rollup-openbsd-x64": "4.59.1",
|
||||||
"@rollup/rollup-openharmony-arm64": "4.59.0"
|
"@rollup/rollup-openharmony-arm64": "4.59.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "1.0.8"
|
"@types/estree": "1.0.8"
|
||||||
|
|
@ -147,12 +147,12 @@
|
||||||
"core-js": "We only update manually as every update requires a snapshot update"
|
"core-js": "We only update manually as every update requires a snapshot update"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@codemirror/commands": "^6.10.2",
|
"@codemirror/commands": "^6.10.3",
|
||||||
"@codemirror/lang-javascript": "^6.2.4",
|
"@codemirror/lang-javascript": "^6.2.5",
|
||||||
"@codemirror/language": "^6.12.1",
|
"@codemirror/language": "^6.12.2",
|
||||||
"@codemirror/search": "^6.6.0",
|
"@codemirror/search": "^6.6.0",
|
||||||
"@codemirror/state": "^6.5.4",
|
"@codemirror/state": "^6.6.0",
|
||||||
"@codemirror/view": "^6.39.14",
|
"@codemirror/view": "^6.40.0",
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@inquirer/prompts": "^7.10.1",
|
"@inquirer/prompts": "^7.10.1",
|
||||||
"@jridgewell/sourcemap-codec": "^1.5.5",
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
||||||
|
|
@ -160,21 +160,21 @@
|
||||||
"@napi-rs/cli": "3.4.1",
|
"@napi-rs/cli": "3.4.1",
|
||||||
"@rollup/plugin-alias": "^6.0.0",
|
"@rollup/plugin-alias": "^6.0.0",
|
||||||
"@rollup/plugin-buble": "^1.0.3",
|
"@rollup/plugin-buble": "^1.0.3",
|
||||||
"@rollup/plugin-commonjs": "^29.0.0",
|
"@rollup/plugin-commonjs": "^29.0.2",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||||
"@rollup/plugin-replace": "^6.0.3",
|
"@rollup/plugin-replace": "^6.0.3",
|
||||||
"@rollup/plugin-terser": "^0.4.4",
|
"@rollup/plugin-terser": "^0.4.4",
|
||||||
"@rollup/plugin-typescript": "^12.3.0",
|
"@rollup/plugin-typescript": "^12.3.0",
|
||||||
"@rollup/pluginutils": "^5.3.0",
|
"@rollup/pluginutils": "^5.3.0",
|
||||||
"@shikijs/vitepress-twoslash": "^3.22.0",
|
"@shikijs/vitepress-twoslash": "^4.0.2",
|
||||||
"@types/mocha": "^10.0.10",
|
"@types/mocha": "^10.0.10",
|
||||||
"@types/node": "^20.19.33",
|
"@types/node": "^20.19.37",
|
||||||
"@types/picomatch": "^4.0.2",
|
"@types/picomatch": "^4.0.2",
|
||||||
"@types/semver": "^7.7.1",
|
"@types/semver": "^7.7.1",
|
||||||
"@types/yargs-parser": "^21.0.3",
|
"@types/yargs-parser": "^21.0.3",
|
||||||
"@vue/language-server": "^3.2.4",
|
"@vue/language-server": "^3.2.5",
|
||||||
"acorn": "^8.15.0",
|
"acorn": "^8.16.0",
|
||||||
"acorn-import-assertions": "^1.9.0",
|
"acorn-import-assertions": "^1.9.0",
|
||||||
"acorn-jsx": "^5.3.2",
|
"acorn-jsx": "^5.3.2",
|
||||||
"buble": "^0.20.0",
|
"buble": "^0.20.0",
|
||||||
|
|
@ -186,26 +186,26 @@
|
||||||
"date-time": "^4.0.0",
|
"date-time": "^4.0.0",
|
||||||
"es5-shim": "^4.6.7",
|
"es5-shim": "^4.6.7",
|
||||||
"es6-shim": "^0.35.8",
|
"es6-shim": "^0.35.8",
|
||||||
"eslint": "^10.0.0",
|
"eslint": "^10.0.3",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-prettier": "^5.5.5",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"eslint-plugin-unicorn": "^63.0.0",
|
"eslint-plugin-unicorn": "^63.0.0",
|
||||||
"eslint-plugin-vue": "^10.8.0",
|
"eslint-plugin-vue": "^10.8.0",
|
||||||
"fixturify": "^3.0.0",
|
"fixturify": "^3.0.0",
|
||||||
"flru": "^1.0.2",
|
"flru": "^1.0.2",
|
||||||
"fs-extra": "^11.3.3",
|
"fs-extra": "^11.3.4",
|
||||||
"github-api": "^3.4.0",
|
"github-api": "^3.4.0",
|
||||||
"globals": "^17.3.0",
|
"globals": "^17.4.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"is-reference": "^3.0.3",
|
"is-reference": "^3.0.3",
|
||||||
"lint-staged": "^16.2.7",
|
"lint-staged": "^16.4.0",
|
||||||
"locate-character": "^3.0.0",
|
"locate-character": "^3.0.0",
|
||||||
"magic-string": "^0.30.21",
|
"magic-string": "^0.30.21",
|
||||||
"memfs": "^4.56.10",
|
"memfs": "^4.56.11",
|
||||||
"mocha": "11.3.0",
|
"mocha": "11.7.5",
|
||||||
"nodemon": "^3.1.11",
|
"nodemon": "^3.1.14",
|
||||||
"npm-audit-resolver": "^3.0.0-RC.0",
|
"npm-audit-resolver": "^3.0.0-RC.0",
|
||||||
"nyc": "^17.1.0",
|
"nyc": "^18.0.0",
|
||||||
"patch-package": "^8.0.1",
|
"patch-package": "^8.0.1",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
"picomatch": "^4.0.3",
|
"picomatch": "^4.0.3",
|
||||||
|
|
@ -215,7 +215,7 @@
|
||||||
"pretty-bytes": "^7.1.0",
|
"pretty-bytes": "^7.1.0",
|
||||||
"pretty-ms": "^9.3.0",
|
"pretty-ms": "^9.3.0",
|
||||||
"requirejs": "^2.3.8",
|
"requirejs": "^2.3.8",
|
||||||
"rollup": "^4.57.1",
|
"rollup": "^4.59.0",
|
||||||
"rollup-plugin-license": "^3.7.0",
|
"rollup-plugin-license": "^3.7.0",
|
||||||
"semver": "^7.7.4",
|
"semver": "^7.7.4",
|
||||||
"shx": "^0.4.0",
|
"shx": "^0.4.0",
|
||||||
|
|
@ -223,24 +223,24 @@
|
||||||
"source-map": "^0.7.6",
|
"source-map": "^0.7.6",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"systemjs": "^6.15.1",
|
"systemjs": "^6.15.1",
|
||||||
"terser": "^5.46.0",
|
"terser": "^5.46.1",
|
||||||
"tslib": "^2.8.1",
|
"tslib": "^2.8.1",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.56.0",
|
"typescript-eslint": "^8.57.1",
|
||||||
"vite": "^7.3.1",
|
"vite": "^7.3.1",
|
||||||
"vitepress": "^1.6.4",
|
"vitepress": "^1.6.4",
|
||||||
"vue": "^3.5.28",
|
"vue": "^3.5.30",
|
||||||
"vue-eslint-parser": "^10.4.0",
|
"vue-eslint-parser": "^10.4.0",
|
||||||
"vue-tsc": "^3.2.4",
|
"vue-tsc": "^3.2.5",
|
||||||
"wasm-pack": "^0.14.0",
|
"wasm-pack": "^0.14.0",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"axios": "^1.13.5",
|
"axios": "^1.13.6",
|
||||||
"esbuild": ">0.24.2",
|
"esbuild": ">0.24.2",
|
||||||
"lodash-es": ">4.17.22",
|
"lodash-es": ">4.17.22",
|
||||||
"path-scurry": {
|
"path-scurry": {
|
||||||
"lru-cache": "^11.2.6"
|
"lru-cache": "^11.2.7"
|
||||||
},
|
},
|
||||||
"readable-stream": "npm:@built-in/readable-stream@1",
|
"readable-stream": "npm:@built-in/readable-stream@1",
|
||||||
"semver": "^7.7.4",
|
"semver": "^7.7.4",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ Vite is released under the MIT license:
|
||||||
|
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2019-present, VoidZero Inc. and Vite contributors
|
Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
@ -25,7 +25,7 @@ SOFTWARE.
|
||||||
|
|
||||||
# Licenses of bundled dependencies
|
# Licenses of bundled dependencies
|
||||||
The published Vite artifact additionally contains code with the following licenses:
|
The published Vite artifact additionally contains code with the following licenses:
|
||||||
Apache-2.0, BSD-2-Clause, BlueOak-1.0.0, CC0-1.0, ISC, MIT
|
Apache-2.0, BSD-2-Clause, CC0-1.0, ISC, MIT
|
||||||
|
|
||||||
# Bundled dependencies:
|
# Bundled dependencies:
|
||||||
## @ampproject/remapping
|
## @ampproject/remapping
|
||||||
|
|
@ -587,6 +587,64 @@ Repository: rollup/plugins
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
## acorn
|
||||||
|
License: MIT
|
||||||
|
By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine
|
||||||
|
Repository: https://github.com/acornjs/acorn.git
|
||||||
|
|
||||||
|
> MIT License
|
||||||
|
>
|
||||||
|
> Copyright (C) 2012-2022 by various contributors (see AUTHORS)
|
||||||
|
>
|
||||||
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
> of this software and associated documentation files (the "Software"), to deal
|
||||||
|
> in the Software without restriction, including without limitation the rights
|
||||||
|
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
> copies of the Software, and to permit persons to whom the Software is
|
||||||
|
> furnished to do so, subject to the following conditions:
|
||||||
|
>
|
||||||
|
> The above copyright notice and this permission notice shall be included in
|
||||||
|
> all copies or substantial portions of the Software.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
> THE SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
## acorn-walk
|
||||||
|
License: MIT
|
||||||
|
By: Marijn Haverbeke, Ingvar Stepanyan, Adrian Heine
|
||||||
|
Repository: https://github.com/acornjs/acorn.git
|
||||||
|
|
||||||
|
> MIT License
|
||||||
|
>
|
||||||
|
> Copyright (C) 2012-2020 by various contributors (see AUTHORS)
|
||||||
|
>
|
||||||
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
> of this software and associated documentation files (the "Software"), to deal
|
||||||
|
> in the Software without restriction, including without limitation the rights
|
||||||
|
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
> copies of the Software, and to permit persons to whom the Software is
|
||||||
|
> furnished to do so, subject to the following conditions:
|
||||||
|
>
|
||||||
|
> The above copyright notice and this permission notice shall be included in
|
||||||
|
> all copies or substantial portions of the Software.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
> THE SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
## ansi-regex
|
## ansi-regex
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Sindre Sorhus
|
By: Sindre Sorhus
|
||||||
|
|
@ -1470,6 +1528,57 @@ Repository: git@github.com:follow-redirects/follow-redirects.git
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
## fs.realpath
|
||||||
|
License: ISC
|
||||||
|
By: Isaac Z. Schlueter
|
||||||
|
Repository: git+https://github.com/isaacs/fs.realpath.git
|
||||||
|
|
||||||
|
> The ISC License
|
||||||
|
>
|
||||||
|
> Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
>
|
||||||
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
> copyright notice and this permission notice appear in all copies.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
>
|
||||||
|
> ----
|
||||||
|
>
|
||||||
|
> This library bundles a version of the `fs.realpath` and `fs.realpathSync`
|
||||||
|
> methods from Node.js v0.10 under the terms of the Node.js MIT license.
|
||||||
|
>
|
||||||
|
> Node's license follows, also included at the header of `old.js` which contains
|
||||||
|
> the licensed code:
|
||||||
|
>
|
||||||
|
> Copyright Joyent, Inc. and other Node contributors.
|
||||||
|
>
|
||||||
|
> Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
> copy of this software and associated documentation files (the "Software"),
|
||||||
|
> to deal in the Software without restriction, including without limitation
|
||||||
|
> the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
> and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
> Software is furnished to do so, subject to the following conditions:
|
||||||
|
>
|
||||||
|
> The above copyright notice and this permission notice shall be included in
|
||||||
|
> all copies or substantial portions of the Software.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
> DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
## generic-names
|
## generic-names
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Alexey Litvinov
|
By: Alexey Litvinov
|
||||||
|
|
@ -1506,7 +1615,7 @@ Repository: git://github.com/isaacs/node-glob.git
|
||||||
|
|
||||||
> The ISC License
|
> The ISC License
|
||||||
>
|
>
|
||||||
> Copyright (c) 2009-2023 Isaac Z. Schlueter and Contributors
|
> Copyright (c) 2009-2022 Isaac Z. Schlueter and Contributors
|
||||||
>
|
>
|
||||||
> Permission to use, copy, modify, and/or distribute this software for any
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
> purpose with or without fee is hereby granted, provided that the above
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
|
@ -1589,6 +1698,51 @@ Repository: git+https://github.com/css-modules/icss-utils.git
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
## inflight
|
||||||
|
License: ISC
|
||||||
|
By: Isaac Z. Schlueter
|
||||||
|
Repository: https://github.com/npm/inflight.git
|
||||||
|
|
||||||
|
> The ISC License
|
||||||
|
>
|
||||||
|
> Copyright (c) Isaac Z. Schlueter
|
||||||
|
>
|
||||||
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
> copyright notice and this permission notice appear in all copies.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
|
## inherits
|
||||||
|
License: ISC
|
||||||
|
Repository: git://github.com/isaacs/inherits
|
||||||
|
|
||||||
|
> The ISC License
|
||||||
|
>
|
||||||
|
> Copyright (c) Isaac Z. Schlueter
|
||||||
|
>
|
||||||
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
> copyright notice and this permission notice appear in all copies.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||||
|
> REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
> FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||||
|
> INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||||
|
> LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
|
> OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
> PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
## is-binary-path
|
## is-binary-path
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Sindre Sorhus
|
By: Sindre Sorhus
|
||||||
|
|
@ -1956,29 +2110,6 @@ Repository: lodash/lodash
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
## lru-cache
|
|
||||||
License: ISC
|
|
||||||
By: Isaac Z. Schlueter
|
|
||||||
Repository: git://github.com/isaacs/node-lru-cache.git
|
|
||||||
|
|
||||||
> The ISC License
|
|
||||||
>
|
|
||||||
> Copyright (c) 2010-2023 Isaac Z. Schlueter and Contributors
|
|
||||||
>
|
|
||||||
> Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
> purpose with or without fee is hereby granted, provided that the above
|
|
||||||
> copyright notice and this permission notice appear in all copies.
|
|
||||||
>
|
|
||||||
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
## magic-string
|
## magic-string
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Rich Harris
|
By: Rich Harris
|
||||||
|
|
@ -2074,29 +2205,6 @@ Repository: git://github.com/isaacs/minimatch.git
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
## minipass
|
|
||||||
License: ISC
|
|
||||||
By: Isaac Z. Schlueter
|
|
||||||
Repository: https://github.com/isaacs/minipass
|
|
||||||
|
|
||||||
> The ISC License
|
|
||||||
>
|
|
||||||
> Copyright (c) 2017-2023 npm, Inc., Isaac Z. Schlueter, and Contributors
|
|
||||||
>
|
|
||||||
> Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
> purpose with or without fee is hereby granted, provided that the above
|
|
||||||
> copyright notice and this permission notice appear in all copies.
|
|
||||||
>
|
|
||||||
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
## mlly
|
## mlly
|
||||||
License: MIT
|
License: MIT
|
||||||
Repository: unjs/mlly
|
Repository: unjs/mlly
|
||||||
|
|
@ -2271,6 +2379,29 @@ Repository: jshttp/on-finished
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
## once
|
||||||
|
License: ISC
|
||||||
|
By: Isaac Z. Schlueter
|
||||||
|
Repository: git://github.com/isaacs/once
|
||||||
|
|
||||||
|
> The ISC License
|
||||||
|
>
|
||||||
|
> Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
>
|
||||||
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
> copyright notice and this permission notice appear in all copies.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
## open
|
## open
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Sindre Sorhus
|
By: Sindre Sorhus
|
||||||
|
|
@ -2363,69 +2494,6 @@ Repository: sindresorhus/path-key
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
## path-scurry
|
|
||||||
License: BlueOak-1.0.0
|
|
||||||
By: Isaac Z. Schlueter
|
|
||||||
Repository: git+https://github.com/isaacs/path-scurry
|
|
||||||
|
|
||||||
> # Blue Oak Model License
|
|
||||||
>
|
|
||||||
> Version 1.0.0
|
|
||||||
>
|
|
||||||
> ## Purpose
|
|
||||||
>
|
|
||||||
> This license gives everyone as much permission to work with
|
|
||||||
> this software as possible, while protecting contributors
|
|
||||||
> from liability.
|
|
||||||
>
|
|
||||||
> ## Acceptance
|
|
||||||
>
|
|
||||||
> In order to receive this license, you must agree to its
|
|
||||||
> rules. The rules of this license are both obligations
|
|
||||||
> under that agreement and conditions to your license.
|
|
||||||
> You must not do anything with this software that triggers
|
|
||||||
> a rule that you cannot or will not follow.
|
|
||||||
>
|
|
||||||
> ## Copyright
|
|
||||||
>
|
|
||||||
> Each contributor licenses you to do everything with this
|
|
||||||
> software that would otherwise infringe that contributor's
|
|
||||||
> copyright in it.
|
|
||||||
>
|
|
||||||
> ## Notices
|
|
||||||
>
|
|
||||||
> You must ensure that everyone who gets a copy of
|
|
||||||
> any part of this software from you, with or without
|
|
||||||
> changes, also gets the text of this license or a link to
|
|
||||||
> <https://blueoakcouncil.org/license/1.0.0>.
|
|
||||||
>
|
|
||||||
> ## Excuse
|
|
||||||
>
|
|
||||||
> If anyone notifies you in writing that you have not
|
|
||||||
> complied with [Notices](#notices), you can keep your
|
|
||||||
> license by taking all practical steps to comply within 30
|
|
||||||
> days after the notice. If you do not do so, your license
|
|
||||||
> ends immediately.
|
|
||||||
>
|
|
||||||
> ## Patent
|
|
||||||
>
|
|
||||||
> Each contributor licenses you to do everything with this
|
|
||||||
> software that would otherwise infringe any patent claims
|
|
||||||
> they can license or become able to license.
|
|
||||||
>
|
|
||||||
> ## Reliability
|
|
||||||
>
|
|
||||||
> No contributor can revoke this license.
|
|
||||||
>
|
|
||||||
> ## No Liability
|
|
||||||
>
|
|
||||||
> ***As far as the law allows, this software comes as is,
|
|
||||||
> without any warranty or condition, and no contributor
|
|
||||||
> will be liable to anyone for any damages related to this
|
|
||||||
> software or this license, under any kind of legal claim.***
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
## periscopic
|
## periscopic
|
||||||
License: MIT
|
License: MIT
|
||||||
Repository: Rich-Harris/periscopic
|
Repository: Rich-Harris/periscopic
|
||||||
|
|
@ -3375,6 +3443,29 @@ Repository: git://github.com/isaacs/node-which.git
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
|
|
||||||
|
## wrappy
|
||||||
|
License: ISC
|
||||||
|
By: Isaac Z. Schlueter
|
||||||
|
Repository: https://github.com/npm/wrappy
|
||||||
|
|
||||||
|
> The ISC License
|
||||||
|
>
|
||||||
|
> Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
>
|
||||||
|
> Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
> purpose with or without fee is hereby granted, provided that the above
|
||||||
|
> copyright notice and this permission notice appear in all copies.
|
||||||
|
>
|
||||||
|
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
> WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
> MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
> ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
> WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
> ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
> IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
---------------------------------------
|
||||||
|
|
||||||
## ws
|
## ws
|
||||||
License: MIT
|
License: MIT
|
||||||
By: Einar Otto Stangvik
|
By: Einar Otto Stangvik
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@
|
||||||
|
|
||||||
Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
|
Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
|
||||||
|
|
||||||
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vite.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vite.dev/guide/features.html#hot-module-replacement).
|
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vitejs.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vitejs.dev/guide/features.html#hot-module-replacement).
|
||||||
|
|
||||||
- A [build command](https://vite.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
|
- A [build command](https://vitejs.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
|
||||||
|
|
||||||
In addition, Vite is highly extensible via its [Plugin API](https://vite.dev/guide/api-plugin.html) and [JavaScript API](https://vite.dev/guide/api-javascript.html) with full typing support.
|
In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/guide/api-plugin.html) and [JavaScript API](https://vitejs.dev/guide/api-javascript.html) with full typing support.
|
||||||
|
|
||||||
[Read the Docs to Learn More](https://vite.dev).
|
[Read the Docs to Learn More](https://vitejs.dev).
|
||||||
|
|
|
||||||
|
|
@ -54,10 +54,6 @@ declare module '*.apng' {
|
||||||
const src: string
|
const src: string
|
||||||
export default src
|
export default src
|
||||||
}
|
}
|
||||||
declare module '*.bmp' {
|
|
||||||
const src: string
|
|
||||||
export default src
|
|
||||||
}
|
|
||||||
declare module '*.png' {
|
declare module '*.png' {
|
||||||
const src: string
|
const src: string
|
||||||
export default src
|
export default src
|
||||||
|
|
@ -246,11 +242,3 @@ declare module '*?inline' {
|
||||||
const src: string
|
const src: string
|
||||||
export default src
|
export default src
|
||||||
}
|
}
|
||||||
|
|
||||||
declare interface VitePreloadErrorEvent extends Event {
|
|
||||||
payload: Error
|
|
||||||
}
|
|
||||||
|
|
||||||
declare interface WindowEventMap {
|
|
||||||
'vite:preloadError': VitePreloadErrorEvent
|
|
||||||
}
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,24 +1,30 @@
|
||||||
const context = (() => {
|
const context = (() => {
|
||||||
if (typeof globalThis !== "undefined") {
|
if (typeof globalThis !== 'undefined') {
|
||||||
return globalThis;
|
return globalThis;
|
||||||
} else if (typeof self !== "undefined") {
|
}
|
||||||
return self;
|
else if (typeof self !== 'undefined') {
|
||||||
} else if (typeof window !== "undefined") {
|
return self;
|
||||||
return window;
|
}
|
||||||
} else {
|
else if (typeof window !== 'undefined') {
|
||||||
return Function("return this")();
|
return window;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return Function('return this')();
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
// assign defines
|
||||||
const defines = __DEFINES__;
|
const defines = __DEFINES__;
|
||||||
Object.keys(defines).forEach((key) => {
|
Object.keys(defines).forEach((key) => {
|
||||||
const segments = key.split(".");
|
const segments = key.split('.');
|
||||||
let target = context;
|
let target = context;
|
||||||
for (let i = 0; i < segments.length; i++) {
|
for (let i = 0; i < segments.length; i++) {
|
||||||
const segment = segments[i];
|
const segment = segments[i];
|
||||||
if (i === segments.length - 1) {
|
if (i === segments.length - 1) {
|
||||||
target[segment] = defines[key];
|
target[segment] = defines[key];
|
||||||
} else {
|
}
|
||||||
target = target[segment] || (target[segment] = {});
|
else {
|
||||||
|
target = target[segment] || (target[segment] = {});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
//# sourceMappingURL=env.mjs.map
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,993 +0,0 @@
|
||||||
import { C as getDefaultExportFromCjs } from './dep-BK3b2jBa.js';
|
|
||||||
import require$$0 from 'path';
|
|
||||||
import require$$0__default from 'fs';
|
|
||||||
import { l as lib } from './dep-IQS-Za7F.js';
|
|
||||||
|
|
||||||
import { fileURLToPath as __cjs_fileURLToPath } from 'node:url';
|
|
||||||
import { dirname as __cjs_dirname } from 'node:path';
|
|
||||||
import { createRequire as __cjs_createRequire } from 'node:module';
|
|
||||||
|
|
||||||
const __filename = __cjs_fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = __cjs_dirname(__filename);
|
|
||||||
const require = __cjs_createRequire(import.meta.url);
|
|
||||||
const __require = require;
|
|
||||||
function _mergeNamespaces(n, m) {
|
|
||||||
for (var i = 0; i < m.length; i++) {
|
|
||||||
var e = m[i];
|
|
||||||
if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) {
|
|
||||||
if (k !== 'default' && !(k in n)) {
|
|
||||||
n[k] = e[k];
|
|
||||||
}
|
|
||||||
} }
|
|
||||||
}
|
|
||||||
return n;
|
|
||||||
}
|
|
||||||
|
|
||||||
var formatImportPrelude$2 = function formatImportPrelude(layer, media, supports) {
|
|
||||||
const parts = [];
|
|
||||||
|
|
||||||
if (typeof layer !== "undefined") {
|
|
||||||
let layerParams = "layer";
|
|
||||||
if (layer) {
|
|
||||||
layerParams = `layer(${layer})`;
|
|
||||||
}
|
|
||||||
|
|
||||||
parts.push(layerParams);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof supports !== "undefined") {
|
|
||||||
parts.push(`supports(${supports})`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof media !== "undefined") {
|
|
||||||
parts.push(media);
|
|
||||||
}
|
|
||||||
|
|
||||||
return parts.join(" ")
|
|
||||||
};
|
|
||||||
|
|
||||||
const formatImportPrelude$1 = formatImportPrelude$2;
|
|
||||||
|
|
||||||
// Base64 encode an import with conditions
|
|
||||||
// The order of conditions is important and is interleaved with cascade layer declarations
|
|
||||||
// Each group of conditions and cascade layers needs to be interpreted in order
|
|
||||||
// To achieve this we create a list of base64 encoded imports, where each import contains a stylesheet with another import.
|
|
||||||
// Each import can define a single group of conditions and a single cascade layer.
|
|
||||||
var base64EncodedImport = function base64EncodedConditionalImport(prelude, conditions) {
|
|
||||||
conditions.reverse();
|
|
||||||
const first = conditions.pop();
|
|
||||||
let params = `${prelude} ${formatImportPrelude$1(
|
|
||||||
first.layer,
|
|
||||||
first.media,
|
|
||||||
first.supports,
|
|
||||||
)}`;
|
|
||||||
|
|
||||||
for (const condition of conditions) {
|
|
||||||
params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString(
|
|
||||||
"base64",
|
|
||||||
)}' ${formatImportPrelude$1(
|
|
||||||
condition.layer,
|
|
||||||
condition.media,
|
|
||||||
condition.supports,
|
|
||||||
)}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return params
|
|
||||||
};
|
|
||||||
|
|
||||||
const base64EncodedConditionalImport = base64EncodedImport;
|
|
||||||
|
|
||||||
var applyConditions$1 = function applyConditions(bundle, atRule) {
|
|
||||||
bundle.forEach(stmt => {
|
|
||||||
if (
|
|
||||||
stmt.type === "charset" ||
|
|
||||||
stmt.type === "warning" ||
|
|
||||||
!stmt.conditions?.length
|
|
||||||
) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stmt.type === "import") {
|
|
||||||
stmt.node.params = base64EncodedConditionalImport(
|
|
||||||
stmt.fullUri,
|
|
||||||
stmt.conditions,
|
|
||||||
);
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const { nodes } = stmt;
|
|
||||||
const { parent } = nodes[0];
|
|
||||||
|
|
||||||
const atRules = [];
|
|
||||||
|
|
||||||
// Convert conditions to at-rules
|
|
||||||
for (const condition of stmt.conditions) {
|
|
||||||
if (typeof condition.media !== "undefined") {
|
|
||||||
const mediaNode = atRule({
|
|
||||||
name: "media",
|
|
||||||
params: condition.media,
|
|
||||||
source: parent.source,
|
|
||||||
});
|
|
||||||
|
|
||||||
atRules.push(mediaNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof condition.supports !== "undefined") {
|
|
||||||
const supportsNode = atRule({
|
|
||||||
name: "supports",
|
|
||||||
params: `(${condition.supports})`,
|
|
||||||
source: parent.source,
|
|
||||||
});
|
|
||||||
|
|
||||||
atRules.push(supportsNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof condition.layer !== "undefined") {
|
|
||||||
const layerNode = atRule({
|
|
||||||
name: "layer",
|
|
||||||
params: condition.layer,
|
|
||||||
source: parent.source,
|
|
||||||
});
|
|
||||||
|
|
||||||
atRules.push(layerNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add nodes to AST
|
|
||||||
const outerAtRule = atRules.shift();
|
|
||||||
const innerAtRule = atRules.reduce((previous, next) => {
|
|
||||||
previous.append(next);
|
|
||||||
return next
|
|
||||||
}, outerAtRule);
|
|
||||||
|
|
||||||
parent.insertBefore(nodes[0], outerAtRule);
|
|
||||||
|
|
||||||
// remove nodes
|
|
||||||
nodes.forEach(node => {
|
|
||||||
node.parent = undefined;
|
|
||||||
});
|
|
||||||
|
|
||||||
// better output
|
|
||||||
nodes[0].raws.before = nodes[0].raws.before || "\n";
|
|
||||||
|
|
||||||
// wrap new rules with media query and/or layer at rule
|
|
||||||
innerAtRule.append(nodes);
|
|
||||||
|
|
||||||
stmt.type = "nodes";
|
|
||||||
stmt.nodes = [outerAtRule];
|
|
||||||
delete stmt.node;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var applyRaws$1 = function applyRaws(bundle) {
|
|
||||||
bundle.forEach((stmt, index) => {
|
|
||||||
if (index === 0) return
|
|
||||||
|
|
||||||
if (stmt.parent) {
|
|
||||||
const { before } = stmt.parent.node.raws;
|
|
||||||
if (stmt.type === "nodes") stmt.nodes[0].raws.before = before;
|
|
||||||
else stmt.node.raws.before = before;
|
|
||||||
} else if (stmt.type === "nodes") {
|
|
||||||
stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var applyStyles$1 = function applyStyles(bundle, styles) {
|
|
||||||
styles.nodes = [];
|
|
||||||
|
|
||||||
// Strip additional statements.
|
|
||||||
bundle.forEach(stmt => {
|
|
||||||
if (["charset", "import"].includes(stmt.type)) {
|
|
||||||
stmt.node.parent = undefined;
|
|
||||||
styles.append(stmt.node);
|
|
||||||
} else if (stmt.type === "nodes") {
|
|
||||||
stmt.nodes.forEach(node => {
|
|
||||||
node.parent = undefined;
|
|
||||||
styles.append(node);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var readCache$1 = {exports: {}};
|
|
||||||
|
|
||||||
var pify$2 = {exports: {}};
|
|
||||||
|
|
||||||
var processFn = function (fn, P, opts) {
|
|
||||||
return function () {
|
|
||||||
var that = this;
|
|
||||||
var args = new Array(arguments.length);
|
|
||||||
|
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
|
||||||
args[i] = arguments[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return new P(function (resolve, reject) {
|
|
||||||
args.push(function (err, result) {
|
|
||||||
if (err) {
|
|
||||||
reject(err);
|
|
||||||
} else if (opts.multiArgs) {
|
|
||||||
var results = new Array(arguments.length - 1);
|
|
||||||
|
|
||||||
for (var i = 1; i < arguments.length; i++) {
|
|
||||||
results[i - 1] = arguments[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
resolve(results);
|
|
||||||
} else {
|
|
||||||
resolve(result);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
fn.apply(that, args);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var pify$1 = pify$2.exports = function (obj, P, opts) {
|
|
||||||
if (typeof P !== 'function') {
|
|
||||||
opts = P;
|
|
||||||
P = Promise;
|
|
||||||
}
|
|
||||||
|
|
||||||
opts = opts || {};
|
|
||||||
opts.exclude = opts.exclude || [/.+Sync$/];
|
|
||||||
|
|
||||||
var filter = function (key) {
|
|
||||||
var match = function (pattern) {
|
|
||||||
return typeof pattern === 'string' ? key === pattern : pattern.test(key);
|
|
||||||
};
|
|
||||||
|
|
||||||
return opts.include ? opts.include.some(match) : !opts.exclude.some(match);
|
|
||||||
};
|
|
||||||
|
|
||||||
var ret = typeof obj === 'function' ? function () {
|
|
||||||
if (opts.excludeMain) {
|
|
||||||
return obj.apply(this, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
return processFn(obj, P, opts).apply(this, arguments);
|
|
||||||
} : {};
|
|
||||||
|
|
||||||
return Object.keys(obj).reduce(function (ret, key) {
|
|
||||||
var x = obj[key];
|
|
||||||
|
|
||||||
ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}, ret);
|
|
||||||
};
|
|
||||||
|
|
||||||
pify$1.all = pify$1;
|
|
||||||
|
|
||||||
var pifyExports = pify$2.exports;
|
|
||||||
|
|
||||||
var fs = require$$0__default;
|
|
||||||
var path$3 = require$$0;
|
|
||||||
var pify = pifyExports;
|
|
||||||
|
|
||||||
var stat = pify(fs.stat);
|
|
||||||
var readFile = pify(fs.readFile);
|
|
||||||
var resolve = path$3.resolve;
|
|
||||||
|
|
||||||
var cache = Object.create(null);
|
|
||||||
|
|
||||||
function convert(content, encoding) {
|
|
||||||
if (Buffer.isEncoding(encoding)) {
|
|
||||||
return content.toString(encoding);
|
|
||||||
}
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
|
|
||||||
readCache$1.exports = function (path, encoding) {
|
|
||||||
path = resolve(path);
|
|
||||||
|
|
||||||
return stat(path).then(function (stats) {
|
|
||||||
var item = cache[path];
|
|
||||||
|
|
||||||
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
|
|
||||||
return convert(item.content, encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
return readFile(path).then(function (data) {
|
|
||||||
cache[path] = {
|
|
||||||
mtime: stats.mtime,
|
|
||||||
content: data
|
|
||||||
};
|
|
||||||
|
|
||||||
return convert(data, encoding);
|
|
||||||
});
|
|
||||||
}).catch(function (err) {
|
|
||||||
cache[path] = null;
|
|
||||||
return Promise.reject(err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
readCache$1.exports.sync = function (path, encoding) {
|
|
||||||
path = resolve(path);
|
|
||||||
|
|
||||||
try {
|
|
||||||
var stats = fs.statSync(path);
|
|
||||||
var item = cache[path];
|
|
||||||
|
|
||||||
if (item && item.mtime.getTime() === stats.mtime.getTime()) {
|
|
||||||
return convert(item.content, encoding);
|
|
||||||
}
|
|
||||||
|
|
||||||
var data = fs.readFileSync(path);
|
|
||||||
|
|
||||||
cache[path] = {
|
|
||||||
mtime: stats.mtime,
|
|
||||||
content: data
|
|
||||||
};
|
|
||||||
|
|
||||||
return convert(data, encoding);
|
|
||||||
} catch (err) {
|
|
||||||
cache[path] = null;
|
|
||||||
throw err;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
readCache$1.exports.get = function (path, encoding) {
|
|
||||||
path = resolve(path);
|
|
||||||
if (cache[path]) {
|
|
||||||
return convert(cache[path].content, encoding);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
readCache$1.exports.clear = function () {
|
|
||||||
cache = Object.create(null);
|
|
||||||
};
|
|
||||||
|
|
||||||
var readCacheExports = readCache$1.exports;
|
|
||||||
|
|
||||||
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
|
||||||
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
|
||||||
const plainDataURLRegexp = /^data:text\/css;plain,/i;
|
|
||||||
|
|
||||||
function isValid(url) {
|
|
||||||
return anyDataURLRegexp.test(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
function contents(url) {
|
|
||||||
if (base64DataURLRegexp.test(url)) {
|
|
||||||
// "data:text/css;base64,".length === 21
|
|
||||||
return Buffer.from(url.slice(21), "base64").toString()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (plainDataURLRegexp.test(url)) {
|
|
||||||
// "data:text/css;plain,".length === 20
|
|
||||||
return decodeURIComponent(url.slice(20))
|
|
||||||
}
|
|
||||||
|
|
||||||
// "data:text/css,".length === 14
|
|
||||||
return decodeURIComponent(url.slice(14))
|
|
||||||
}
|
|
||||||
|
|
||||||
var dataUrl = {
|
|
||||||
isValid,
|
|
||||||
contents,
|
|
||||||
};
|
|
||||||
|
|
||||||
const readCache = readCacheExports;
|
|
||||||
const dataURL$1 = dataUrl;
|
|
||||||
|
|
||||||
var loadContent$1 = function loadContent(filename) {
|
|
||||||
if (dataURL$1.isValid(filename)) {
|
|
||||||
return dataURL$1.contents(filename)
|
|
||||||
}
|
|
||||||
|
|
||||||
return readCache(filename, "utf-8")
|
|
||||||
};
|
|
||||||
|
|
||||||
// external tooling
|
|
||||||
const valueParser = lib;
|
|
||||||
|
|
||||||
// extended tooling
|
|
||||||
const { stringify } = valueParser;
|
|
||||||
|
|
||||||
var parseStatements$1 = function parseStatements(result, styles, conditions, from) {
|
|
||||||
const statements = [];
|
|
||||||
let nodes = [];
|
|
||||||
|
|
||||||
styles.each(node => {
|
|
||||||
let stmt;
|
|
||||||
if (node.type === "atrule") {
|
|
||||||
if (node.name === "import")
|
|
||||||
stmt = parseImport(result, node, conditions, from);
|
|
||||||
else if (node.name === "charset")
|
|
||||||
stmt = parseCharset(result, node, conditions, from);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stmt) {
|
|
||||||
if (nodes.length) {
|
|
||||||
statements.push({
|
|
||||||
type: "nodes",
|
|
||||||
nodes,
|
|
||||||
conditions: [...conditions],
|
|
||||||
from,
|
|
||||||
});
|
|
||||||
nodes = [];
|
|
||||||
}
|
|
||||||
statements.push(stmt);
|
|
||||||
} else nodes.push(node);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (nodes.length) {
|
|
||||||
statements.push({
|
|
||||||
type: "nodes",
|
|
||||||
nodes,
|
|
||||||
conditions: [...conditions],
|
|
||||||
from,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return statements
|
|
||||||
};
|
|
||||||
|
|
||||||
function parseCharset(result, atRule, conditions, from) {
|
|
||||||
if (atRule.prev()) {
|
|
||||||
return result.warn("@charset must precede all other statements", {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
type: "charset",
|
|
||||||
node: atRule,
|
|
||||||
conditions: [...conditions],
|
|
||||||
from,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function parseImport(result, atRule, conditions, from) {
|
|
||||||
let prev = atRule.prev();
|
|
||||||
|
|
||||||
// `@import` statements may follow other `@import` statements.
|
|
||||||
if (prev) {
|
|
||||||
do {
|
|
||||||
if (
|
|
||||||
prev.type === "comment" ||
|
|
||||||
(prev.type === "atrule" && prev.name === "import")
|
|
||||||
) {
|
|
||||||
prev = prev.prev();
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
|
||||||
} while (prev)
|
|
||||||
}
|
|
||||||
|
|
||||||
// All `@import` statements may be preceded by `@charset` or `@layer` statements.
|
|
||||||
// But the `@import` statements must be consecutive.
|
|
||||||
if (prev) {
|
|
||||||
do {
|
|
||||||
if (
|
|
||||||
prev.type === "comment" ||
|
|
||||||
(prev.type === "atrule" &&
|
|
||||||
(prev.name === "charset" || (prev.name === "layer" && !prev.nodes)))
|
|
||||||
) {
|
|
||||||
prev = prev.prev();
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.warn(
|
|
||||||
"@import must precede all other statements (besides @charset or empty @layer)",
|
|
||||||
{ node: atRule },
|
|
||||||
)
|
|
||||||
} while (prev)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (atRule.nodes) {
|
|
||||||
return result.warn(
|
|
||||||
"It looks like you didn't end your @import statement correctly. " +
|
|
||||||
"Child nodes are attached to it.",
|
|
||||||
{ node: atRule },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = valueParser(atRule.params).nodes;
|
|
||||||
const stmt = {
|
|
||||||
type: "import",
|
|
||||||
uri: "",
|
|
||||||
fullUri: "",
|
|
||||||
node: atRule,
|
|
||||||
conditions: [...conditions],
|
|
||||||
from,
|
|
||||||
};
|
|
||||||
|
|
||||||
let layer;
|
|
||||||
let media;
|
|
||||||
let supports;
|
|
||||||
|
|
||||||
for (let i = 0; i < params.length; i++) {
|
|
||||||
const node = params[i];
|
|
||||||
|
|
||||||
if (node.type === "space" || node.type === "comment") continue
|
|
||||||
|
|
||||||
if (node.type === "string") {
|
|
||||||
if (stmt.uri) {
|
|
||||||
return result.warn(`Multiple url's in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!node.value) {
|
|
||||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
stmt.uri = node.value;
|
|
||||||
stmt.fullUri = stringify(node);
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.type === "function" && /^url$/i.test(node.value)) {
|
|
||||||
if (stmt.uri) {
|
|
||||||
return result.warn(`Multiple url's in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!node.nodes?.[0]?.value) {
|
|
||||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
stmt.uri = node.nodes[0].value;
|
|
||||||
stmt.fullUri = stringify(node);
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!stmt.uri) {
|
|
||||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
(node.type === "word" || node.type === "function") &&
|
|
||||||
/^layer$/i.test(node.value)
|
|
||||||
) {
|
|
||||||
if (typeof layer !== "undefined") {
|
|
||||||
return result.warn(`Multiple layers in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof supports !== "undefined") {
|
|
||||||
return result.warn(
|
|
||||||
`layers must be defined before support conditions in '${atRule.toString()}'`,
|
|
||||||
{
|
|
||||||
node: atRule,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.nodes) {
|
|
||||||
layer = stringify(node.nodes);
|
|
||||||
} else {
|
|
||||||
layer = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (node.type === "function" && /^supports$/i.test(node.value)) {
|
|
||||||
if (typeof supports !== "undefined") {
|
|
||||||
return result.warn(
|
|
||||||
`Multiple support conditions in '${atRule.toString()}'`,
|
|
||||||
{
|
|
||||||
node: atRule,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
supports = stringify(node.nodes);
|
|
||||||
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
media = stringify(params.slice(i));
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!stmt.uri) {
|
|
||||||
return result.warn(`Unable to find uri in '${atRule.toString()}'`, {
|
|
||||||
node: atRule,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
typeof media !== "undefined" ||
|
|
||||||
typeof layer !== "undefined" ||
|
|
||||||
typeof supports !== "undefined"
|
|
||||||
) {
|
|
||||||
stmt.conditions.push({
|
|
||||||
layer,
|
|
||||||
media,
|
|
||||||
supports,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return stmt
|
|
||||||
}
|
|
||||||
|
|
||||||
// builtin tooling
|
|
||||||
const path$2 = require$$0;
|
|
||||||
|
|
||||||
// placeholder tooling
|
|
||||||
let sugarss;
|
|
||||||
|
|
||||||
var processContent$1 = function processContent(
|
|
||||||
result,
|
|
||||||
content,
|
|
||||||
filename,
|
|
||||||
options,
|
|
||||||
postcss,
|
|
||||||
) {
|
|
||||||
const { plugins } = options;
|
|
||||||
const ext = path$2.extname(filename);
|
|
||||||
|
|
||||||
const parserList = [];
|
|
||||||
|
|
||||||
// SugarSS support:
|
|
||||||
if (ext === ".sss") {
|
|
||||||
if (!sugarss) {
|
|
||||||
/* c8 ignore next 3 */
|
|
||||||
try {
|
|
||||||
sugarss = __require('sugarss');
|
|
||||||
} catch {} // Ignore
|
|
||||||
}
|
|
||||||
if (sugarss)
|
|
||||||
return runPostcss(postcss, content, filename, plugins, [sugarss])
|
|
||||||
}
|
|
||||||
|
|
||||||
// Syntax support:
|
|
||||||
if (result.opts.syntax?.parse) {
|
|
||||||
parserList.push(result.opts.syntax.parse);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parser support:
|
|
||||||
if (result.opts.parser) parserList.push(result.opts.parser);
|
|
||||||
// Try the default as a last resort:
|
|
||||||
parserList.push(null);
|
|
||||||
|
|
||||||
return runPostcss(postcss, content, filename, plugins, parserList)
|
|
||||||
};
|
|
||||||
|
|
||||||
function runPostcss(postcss, content, filename, plugins, parsers, index) {
|
|
||||||
if (!index) index = 0;
|
|
||||||
return postcss(plugins)
|
|
||||||
.process(content, {
|
|
||||||
from: filename,
|
|
||||||
parser: parsers[index],
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
// If there's an error, try the next parser
|
|
||||||
index++;
|
|
||||||
// If there are no parsers left, throw it
|
|
||||||
if (index === parsers.length) throw err
|
|
||||||
return runPostcss(postcss, content, filename, plugins, parsers, index)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const path$1 = require$$0;
|
|
||||||
|
|
||||||
const dataURL = dataUrl;
|
|
||||||
const parseStatements = parseStatements$1;
|
|
||||||
const processContent = processContent$1;
|
|
||||||
const resolveId$1 = (id) => id;
|
|
||||||
const formatImportPrelude = formatImportPrelude$2;
|
|
||||||
|
|
||||||
async function parseStyles$1(
|
|
||||||
result,
|
|
||||||
styles,
|
|
||||||
options,
|
|
||||||
state,
|
|
||||||
conditions,
|
|
||||||
from,
|
|
||||||
postcss,
|
|
||||||
) {
|
|
||||||
const statements = parseStatements(result, styles, conditions, from);
|
|
||||||
|
|
||||||
for (const stmt of statements) {
|
|
||||||
if (stmt.type !== "import" || !isProcessableURL(stmt.uri)) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.filter && !options.filter(stmt.uri)) {
|
|
||||||
// rejected by filter
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
await resolveImportId(result, stmt, options, state, postcss);
|
|
||||||
}
|
|
||||||
|
|
||||||
let charset;
|
|
||||||
const imports = [];
|
|
||||||
const bundle = [];
|
|
||||||
|
|
||||||
function handleCharset(stmt) {
|
|
||||||
if (!charset) charset = stmt;
|
|
||||||
// charsets aren't case-sensitive, so convert to lower case to compare
|
|
||||||
else if (
|
|
||||||
stmt.node.params.toLowerCase() !== charset.node.params.toLowerCase()
|
|
||||||
) {
|
|
||||||
throw stmt.node.error(
|
|
||||||
`Incompatible @charset statements:
|
|
||||||
${stmt.node.params} specified in ${stmt.node.source.input.file}
|
|
||||||
${charset.node.params} specified in ${charset.node.source.input.file}`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// squash statements and their children
|
|
||||||
statements.forEach(stmt => {
|
|
||||||
if (stmt.type === "charset") handleCharset(stmt);
|
|
||||||
else if (stmt.type === "import") {
|
|
||||||
if (stmt.children) {
|
|
||||||
stmt.children.forEach((child, index) => {
|
|
||||||
if (child.type === "import") imports.push(child);
|
|
||||||
else if (child.type === "charset") handleCharset(child);
|
|
||||||
else bundle.push(child);
|
|
||||||
// For better output
|
|
||||||
if (index === 0) child.parent = stmt;
|
|
||||||
});
|
|
||||||
} else imports.push(stmt);
|
|
||||||
} else if (stmt.type === "nodes") {
|
|
||||||
bundle.push(stmt);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return charset ? [charset, ...imports.concat(bundle)] : imports.concat(bundle)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function resolveImportId(result, stmt, options, state, postcss) {
|
|
||||||
if (dataURL.isValid(stmt.uri)) {
|
|
||||||
// eslint-disable-next-line require-atomic-updates
|
|
||||||
stmt.children = await loadImportContent(
|
|
||||||
result,
|
|
||||||
stmt,
|
|
||||||
stmt.uri,
|
|
||||||
options,
|
|
||||||
state,
|
|
||||||
postcss,
|
|
||||||
);
|
|
||||||
|
|
||||||
return
|
|
||||||
} else if (dataURL.isValid(stmt.from.slice(-1))) {
|
|
||||||
// Data urls can't be used as a base url to resolve imports.
|
|
||||||
throw stmt.node.error(
|
|
||||||
`Unable to import '${stmt.uri}' from a stylesheet that is embedded in a data url`,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
const atRule = stmt.node;
|
|
||||||
let sourceFile;
|
|
||||||
if (atRule.source?.input?.file) {
|
|
||||||
sourceFile = atRule.source.input.file;
|
|
||||||
}
|
|
||||||
const base = sourceFile
|
|
||||||
? path$1.dirname(atRule.source.input.file)
|
|
||||||
: options.root;
|
|
||||||
|
|
||||||
const paths = [await options.resolve(stmt.uri, base, options, atRule)].flat();
|
|
||||||
|
|
||||||
// Ensure that each path is absolute:
|
|
||||||
const resolved = await Promise.all(
|
|
||||||
paths.map(file => {
|
|
||||||
return !path$1.isAbsolute(file)
|
|
||||||
? resolveId$1(file)
|
|
||||||
: file
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Add dependency messages:
|
|
||||||
resolved.forEach(file => {
|
|
||||||
result.messages.push({
|
|
||||||
type: "dependency",
|
|
||||||
plugin: "postcss-import",
|
|
||||||
file,
|
|
||||||
parent: sourceFile,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const importedContent = await Promise.all(
|
|
||||||
resolved.map(file => {
|
|
||||||
return loadImportContent(result, stmt, file, options, state, postcss)
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
// Merge loaded statements
|
|
||||||
// eslint-disable-next-line require-atomic-updates
|
|
||||||
stmt.children = importedContent.flat().filter(x => !!x);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadImportContent(
|
|
||||||
result,
|
|
||||||
stmt,
|
|
||||||
filename,
|
|
||||||
options,
|
|
||||||
state,
|
|
||||||
postcss,
|
|
||||||
) {
|
|
||||||
const atRule = stmt.node;
|
|
||||||
const { conditions, from } = stmt;
|
|
||||||
const stmtDuplicateCheckKey = conditions
|
|
||||||
.map(condition =>
|
|
||||||
formatImportPrelude(condition.layer, condition.media, condition.supports),
|
|
||||||
)
|
|
||||||
.join(":");
|
|
||||||
|
|
||||||
if (options.skipDuplicates) {
|
|
||||||
// skip files already imported at the same scope
|
|
||||||
if (state.importedFiles[filename]?.[stmtDuplicateCheckKey]) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// save imported files to skip them next time
|
|
||||||
if (!state.importedFiles[filename]) {
|
|
||||||
state.importedFiles[filename] = {};
|
|
||||||
}
|
|
||||||
state.importedFiles[filename][stmtDuplicateCheckKey] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (from.includes(filename)) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const content = await options.load(filename, options);
|
|
||||||
|
|
||||||
if (content.trim() === "" && options.warnOnEmpty) {
|
|
||||||
result.warn(`${filename} is empty`, { node: atRule });
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// skip previous imported files not containing @import rules
|
|
||||||
if (
|
|
||||||
options.skipDuplicates &&
|
|
||||||
state.hashFiles[content]?.[stmtDuplicateCheckKey]
|
|
||||||
) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const importedResult = await processContent(
|
|
||||||
result,
|
|
||||||
content,
|
|
||||||
filename,
|
|
||||||
options,
|
|
||||||
postcss,
|
|
||||||
);
|
|
||||||
|
|
||||||
const styles = importedResult.root;
|
|
||||||
result.messages = result.messages.concat(importedResult.messages);
|
|
||||||
|
|
||||||
if (options.skipDuplicates) {
|
|
||||||
const hasImport = styles.some(child => {
|
|
||||||
return child.type === "atrule" && child.name === "import"
|
|
||||||
});
|
|
||||||
if (!hasImport) {
|
|
||||||
// save hash files to skip them next time
|
|
||||||
if (!state.hashFiles[content]) {
|
|
||||||
state.hashFiles[content] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
state.hashFiles[content][stmtDuplicateCheckKey] = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// recursion: import @import from imported file
|
|
||||||
return parseStyles$1(
|
|
||||||
result,
|
|
||||||
styles,
|
|
||||||
options,
|
|
||||||
state,
|
|
||||||
conditions,
|
|
||||||
[...from, filename],
|
|
||||||
postcss,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function isProcessableURL(uri) {
|
|
||||||
// skip protocol base uri (protocol://url) or protocol-relative
|
|
||||||
if (/^(?:[a-z]+:)?\/\//i.test(uri)) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for fragment or query
|
|
||||||
try {
|
|
||||||
// needs a base to parse properly
|
|
||||||
const url = new URL(uri, "https://example.com");
|
|
||||||
if (url.search) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
} catch {} // Ignore
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
var parseStyles_1 = parseStyles$1;
|
|
||||||
|
|
||||||
// builtin tooling
|
|
||||||
const path = require$$0;
|
|
||||||
|
|
||||||
// internal tooling
|
|
||||||
const applyConditions = applyConditions$1;
|
|
||||||
const applyRaws = applyRaws$1;
|
|
||||||
const applyStyles = applyStyles$1;
|
|
||||||
const loadContent = loadContent$1;
|
|
||||||
const parseStyles = parseStyles_1;
|
|
||||||
const resolveId = (id) => id;
|
|
||||||
|
|
||||||
function AtImport(options) {
|
|
||||||
options = {
|
|
||||||
root: process.cwd(),
|
|
||||||
path: [],
|
|
||||||
skipDuplicates: true,
|
|
||||||
resolve: resolveId,
|
|
||||||
load: loadContent,
|
|
||||||
plugins: [],
|
|
||||||
addModulesDirectories: [],
|
|
||||||
warnOnEmpty: true,
|
|
||||||
...options,
|
|
||||||
};
|
|
||||||
|
|
||||||
options.root = path.resolve(options.root);
|
|
||||||
|
|
||||||
// convert string to an array of a single element
|
|
||||||
if (typeof options.path === "string") options.path = [options.path];
|
|
||||||
|
|
||||||
if (!Array.isArray(options.path)) options.path = [];
|
|
||||||
|
|
||||||
options.path = options.path.map(p => path.resolve(options.root, p));
|
|
||||||
|
|
||||||
return {
|
|
||||||
postcssPlugin: "postcss-import",
|
|
||||||
async Once(styles, { result, atRule, postcss }) {
|
|
||||||
const state = {
|
|
||||||
importedFiles: {},
|
|
||||||
hashFiles: {},
|
|
||||||
};
|
|
||||||
|
|
||||||
if (styles.source?.input?.file) {
|
|
||||||
state.importedFiles[styles.source.input.file] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (options.plugins && !Array.isArray(options.plugins)) {
|
|
||||||
throw new Error("plugins option must be an array")
|
|
||||||
}
|
|
||||||
|
|
||||||
const bundle = await parseStyles(
|
|
||||||
result,
|
|
||||||
styles,
|
|
||||||
options,
|
|
||||||
state,
|
|
||||||
[],
|
|
||||||
[],
|
|
||||||
postcss,
|
|
||||||
);
|
|
||||||
|
|
||||||
applyRaws(bundle);
|
|
||||||
applyConditions(bundle, atRule);
|
|
||||||
applyStyles(bundle, styles);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AtImport.postcss = true;
|
|
||||||
|
|
||||||
var postcssImport = AtImport;
|
|
||||||
|
|
||||||
var index = /*@__PURE__*/getDefaultExportFromCjs(postcssImport);
|
|
||||||
|
|
||||||
var index$1 = /*#__PURE__*/_mergeNamespaces({
|
|
||||||
__proto__: null,
|
|
||||||
default: index
|
|
||||||
}, [postcssImport]);
|
|
||||||
|
|
||||||
export { index$1 as i };
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
|
@ -1,21 +1,18 @@
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import fs__default from 'node:fs';
|
import fs from 'node:fs';
|
||||||
import { performance } from 'node:perf_hooks';
|
import { performance } from 'node:perf_hooks';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { B as colors, v as createLogger, r as resolveConfig } from './chunks/dep-BK3b2jBa.js';
|
import { A as colors, v as createLogger, r as resolveConfig } from './chunks/dep-p3C6MpSJ.js';
|
||||||
import { VERSION } from './constants.js';
|
import { VERSION } from './constants.js';
|
||||||
import 'node:fs/promises';
|
import 'node:fs/promises';
|
||||||
import 'node:url';
|
import 'node:url';
|
||||||
import 'node:util';
|
import 'node:util';
|
||||||
import 'node:module';
|
import 'node:module';
|
||||||
import 'node:crypto';
|
|
||||||
import 'tty';
|
import 'tty';
|
||||||
import 'path';
|
import 'path';
|
||||||
import 'esbuild';
|
import 'esbuild';
|
||||||
import 'fs';
|
import 'fs';
|
||||||
import 'node:events';
|
import 'assert';
|
||||||
import 'node:stream';
|
|
||||||
import 'node:string_decoder';
|
|
||||||
import 'node:child_process';
|
import 'node:child_process';
|
||||||
import 'node:http';
|
import 'node:http';
|
||||||
import 'node:https';
|
import 'node:https';
|
||||||
|
|
@ -27,6 +24,7 @@ import 'stream';
|
||||||
import 'os';
|
import 'os';
|
||||||
import 'child_process';
|
import 'child_process';
|
||||||
import 'node:os';
|
import 'node:os';
|
||||||
|
import 'node:crypto';
|
||||||
import 'node:dns';
|
import 'node:dns';
|
||||||
import 'crypto';
|
import 'crypto';
|
||||||
import 'module';
|
import 'module';
|
||||||
|
|
@ -34,6 +32,7 @@ import 'node:assert';
|
||||||
import 'node:v8';
|
import 'node:v8';
|
||||||
import 'node:worker_threads';
|
import 'node:worker_threads';
|
||||||
import 'node:buffer';
|
import 'node:buffer';
|
||||||
|
import 'node:events';
|
||||||
import 'rollup/parseAst';
|
import 'rollup/parseAst';
|
||||||
import 'querystring';
|
import 'querystring';
|
||||||
import 'node:readline';
|
import 'node:readline';
|
||||||
|
|
@ -41,8 +40,6 @@ import 'zlib';
|
||||||
import 'buffer';
|
import 'buffer';
|
||||||
import 'https';
|
import 'https';
|
||||||
import 'tls';
|
import 'tls';
|
||||||
import 'node:net';
|
|
||||||
import 'assert';
|
|
||||||
import 'node:zlib';
|
import 'node:zlib';
|
||||||
|
|
||||||
function toArr(any) {
|
function toArr(any) {
|
||||||
|
|
@ -658,258 +655,269 @@ class CAC extends EventEmitter {
|
||||||
|
|
||||||
const cac = (name = "") => new CAC(name);
|
const cac = (name = "") => new CAC(name);
|
||||||
|
|
||||||
const cli = cac("vite");
|
const cli = cac('vite');
|
||||||
let profileSession = global.__vite_profile_session;
|
let profileSession = global.__vite_profile_session;
|
||||||
let profileCount = 0;
|
let profileCount = 0;
|
||||||
const stopProfiler = (log) => {
|
const stopProfiler = (log) => {
|
||||||
if (!profileSession) return;
|
if (!profileSession)
|
||||||
return new Promise((res, rej) => {
|
return;
|
||||||
profileSession.post("Profiler.stop", (err, { profile }) => {
|
return new Promise((res, rej) => {
|
||||||
if (!err) {
|
profileSession.post('Profiler.stop', (err, { profile }) => {
|
||||||
const outPath = path.resolve(
|
// Write profile to disk, upload, etc.
|
||||||
`./vite-profile-${profileCount++}.cpuprofile`
|
if (!err) {
|
||||||
);
|
const outPath = path.resolve(`./vite-profile-${profileCount++}.cpuprofile`);
|
||||||
fs__default.writeFileSync(outPath, JSON.stringify(profile));
|
fs.writeFileSync(outPath, JSON.stringify(profile));
|
||||||
log(
|
log(colors.yellow(`CPU profile written to ${colors.white(colors.dim(outPath))}`));
|
||||||
colors.yellow(
|
profileSession = undefined;
|
||||||
`CPU profile written to ${colors.white(colors.dim(outPath))}`
|
res();
|
||||||
)
|
}
|
||||||
);
|
else {
|
||||||
profileSession = void 0;
|
rej(err);
|
||||||
res();
|
}
|
||||||
} else {
|
});
|
||||||
rej(err);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
const filterDuplicateOptions = (options) => {
|
const filterDuplicateOptions = (options) => {
|
||||||
for (const [key, value] of Object.entries(options)) {
|
for (const [key, value] of Object.entries(options)) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
options[key] = value[value.length - 1];
|
options[key] = value[value.length - 1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* removing global flags before passing as command specific sub-configs
|
||||||
|
*/
|
||||||
function cleanOptions(options) {
|
function cleanOptions(options) {
|
||||||
const ret = { ...options };
|
const ret = { ...options };
|
||||||
delete ret["--"];
|
delete ret['--'];
|
||||||
delete ret.c;
|
delete ret.c;
|
||||||
delete ret.config;
|
delete ret.config;
|
||||||
delete ret.base;
|
delete ret.base;
|
||||||
delete ret.l;
|
delete ret.l;
|
||||||
delete ret.logLevel;
|
delete ret.logLevel;
|
||||||
delete ret.clearScreen;
|
delete ret.clearScreen;
|
||||||
delete ret.d;
|
delete ret.d;
|
||||||
delete ret.debug;
|
delete ret.debug;
|
||||||
delete ret.f;
|
delete ret.f;
|
||||||
delete ret.filter;
|
delete ret.filter;
|
||||||
delete ret.m;
|
delete ret.m;
|
||||||
delete ret.mode;
|
delete ret.mode;
|
||||||
if ("sourcemap" in ret) {
|
// convert the sourcemap option to a boolean if necessary
|
||||||
const sourcemap = ret.sourcemap;
|
if ('sourcemap' in ret) {
|
||||||
ret.sourcemap = sourcemap === "true" ? true : sourcemap === "false" ? false : ret.sourcemap;
|
const sourcemap = ret.sourcemap;
|
||||||
}
|
ret.sourcemap =
|
||||||
return ret;
|
sourcemap === 'true'
|
||||||
|
? true
|
||||||
|
: sourcemap === 'false'
|
||||||
|
? false
|
||||||
|
: ret.sourcemap;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* host may be a number (like 0), should convert to string
|
||||||
|
*/
|
||||||
const convertHost = (v) => {
|
const convertHost = (v) => {
|
||||||
if (typeof v === "number") {
|
if (typeof v === 'number') {
|
||||||
return String(v);
|
return String(v);
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* base may be a number (like 0), should convert to empty string
|
||||||
|
*/
|
||||||
const convertBase = (v) => {
|
const convertBase = (v) => {
|
||||||
if (v === 0) {
|
if (v === 0) {
|
||||||
return "";
|
return '';
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
};
|
};
|
||||||
cli.option("-c, --config <file>", `[string] use specified config file`).option("--base <path>", `[string] public base path (default: /)`, {
|
cli
|
||||||
type: [convertBase]
|
.option('-c, --config <file>', `[string] use specified config file`)
|
||||||
}).option("-l, --logLevel <level>", `[string] info | warn | error | silent`).option("--clearScreen", `[boolean] allow/disable clear screen when logging`).option("-d, --debug [feat]", `[string | boolean] show debug logs`).option("-f, --filter <filter>", `[string] filter debug logs`).option("-m, --mode <mode>", `[string] set env mode`);
|
.option('--base <path>', `[string] public base path (default: /)`, {
|
||||||
cli.command("[root]", "start dev server").alias("serve").alias("dev").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--open [path]", `[boolean | string] open browser on startup`).option("--cors", `[boolean] enable CORS`).option("--strictPort", `[boolean] exit if specified port is already in use`).option(
|
type: [convertBase],
|
||||||
"--force",
|
})
|
||||||
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
.option('-l, --logLevel <level>', `[string] info | warn | error | silent`)
|
||||||
).action(async (root, options) => {
|
.option('--clearScreen', `[boolean] allow/disable clear screen when logging`)
|
||||||
filterDuplicateOptions(options);
|
.option('-d, --debug [feat]', `[string | boolean] show debug logs`)
|
||||||
const { createServer } = await import('./chunks/dep-BK3b2jBa.js').then(function (n) { return n.F; });
|
.option('-f, --filter <filter>', `[string] filter debug logs`)
|
||||||
try {
|
.option('-m, --mode <mode>', `[string] set env mode`);
|
||||||
const server = await createServer({
|
// dev
|
||||||
root,
|
cli
|
||||||
base: options.base,
|
.command('[root]', 'start dev server') // default command
|
||||||
mode: options.mode,
|
.alias('serve') // the command is called 'serve' in Vite's API
|
||||||
configFile: options.config,
|
.alias('dev') // alias to align with the script name
|
||||||
logLevel: options.logLevel,
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
||||||
clearScreen: options.clearScreen,
|
.option('--port <port>', `[number] specify port`)
|
||||||
optimizeDeps: { force: options.force },
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
||||||
server: cleanOptions(options)
|
.option('--cors', `[boolean] enable CORS`)
|
||||||
});
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
||||||
if (!server.httpServer) {
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
||||||
throw new Error("HTTP server not available");
|
.action(async (root, options) => {
|
||||||
}
|
filterDuplicateOptions(options);
|
||||||
await server.listen();
|
// output structure is preserved even after bundling so require()
|
||||||
const info = server.config.logger.info;
|
// is ok here
|
||||||
const viteStartTime = global.__vite_start_time ?? false;
|
const { createServer } = await import('./chunks/dep-p3C6MpSJ.js').then(function (n) { return n.E; });
|
||||||
const startupDurationString = viteStartTime ? colors.dim(
|
try {
|
||||||
`ready in ${colors.reset(
|
const server = await createServer({
|
||||||
colors.bold(Math.ceil(performance.now() - viteStartTime))
|
root,
|
||||||
)} ms`
|
base: options.base,
|
||||||
) : "";
|
mode: options.mode,
|
||||||
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
configFile: options.config,
|
||||||
info(
|
logLevel: options.logLevel,
|
||||||
`
|
clearScreen: options.clearScreen,
|
||||||
${colors.green(
|
optimizeDeps: { force: options.force },
|
||||||
`${colors.bold("VITE")} v${VERSION}`
|
server: cleanOptions(options),
|
||||||
)} ${startupDurationString}
|
});
|
||||||
`,
|
if (!server.httpServer) {
|
||||||
{
|
throw new Error('HTTP server not available');
|
||||||
clear: !hasExistingLogs
|
}
|
||||||
}
|
await server.listen();
|
||||||
);
|
const info = server.config.logger.info;
|
||||||
server.printUrls();
|
const viteStartTime = global.__vite_start_time ?? false;
|
||||||
const customShortcuts = [];
|
const startupDurationString = viteStartTime
|
||||||
if (profileSession) {
|
? colors.dim(`ready in ${colors.reset(colors.bold(Math.ceil(performance.now() - viteStartTime)))} ms`)
|
||||||
customShortcuts.push({
|
: '';
|
||||||
key: "p",
|
const hasExistingLogs = process.stdout.bytesWritten > 0 || process.stderr.bytesWritten > 0;
|
||||||
description: "start/stop the profiler",
|
info(`\n ${colors.green(`${colors.bold('VITE')} v${VERSION}`)} ${startupDurationString}\n`, {
|
||||||
async action(server2) {
|
clear: !hasExistingLogs,
|
||||||
if (profileSession) {
|
});
|
||||||
await stopProfiler(server2.config.logger.info);
|
server.printUrls();
|
||||||
} else {
|
const customShortcuts = [];
|
||||||
const inspector = await import('node:inspector').then(
|
if (profileSession) {
|
||||||
(r) => r.default
|
customShortcuts.push({
|
||||||
);
|
key: 'p',
|
||||||
await new Promise((res) => {
|
description: 'start/stop the profiler',
|
||||||
profileSession = new inspector.Session();
|
async action(server) {
|
||||||
profileSession.connect();
|
if (profileSession) {
|
||||||
profileSession.post("Profiler.enable", () => {
|
await stopProfiler(server.config.logger.info);
|
||||||
profileSession.post("Profiler.start", () => {
|
}
|
||||||
server2.config.logger.info("Profiler started");
|
else {
|
||||||
res();
|
const inspector = await import('node:inspector').then((r) => r.default);
|
||||||
});
|
await new Promise((res) => {
|
||||||
});
|
profileSession = new inspector.Session();
|
||||||
|
profileSession.connect();
|
||||||
|
profileSession.post('Profiler.enable', () => {
|
||||||
|
profileSession.post('Profiler.start', () => {
|
||||||
|
server.config.logger.info('Profiler started');
|
||||||
|
res();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
server.bindCLIShortcuts({ print: true, customShortcuts });
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
const logger = createLogger(options.logLevel);
|
||||||
|
logger.error(colors.red(`error when starting dev server:\n${e.stack}`), {
|
||||||
|
error: e,
|
||||||
|
});
|
||||||
|
stopProfiler(logger.info);
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
server.bindCLIShortcuts({ print: true, customShortcuts });
|
|
||||||
} catch (e) {
|
|
||||||
const logger = createLogger(options.logLevel);
|
|
||||||
logger.error(colors.red(`error when starting dev server:
|
|
||||||
${e.stack}`), {
|
|
||||||
error: e
|
|
||||||
});
|
|
||||||
stopProfiler(logger.info);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
cli.command("build [root]", "build for production").option("--target <target>", `[string] transpile target (default: 'modules')`).option("--outDir <dir>", `[string] output directory (default: dist)`).option(
|
// build
|
||||||
"--assetsDir <dir>",
|
cli
|
||||||
`[string] directory under outDir to place assets in (default: assets)`
|
.command('build [root]', 'build for production')
|
||||||
).option(
|
.option('--target <target>', `[string] transpile target (default: 'modules')`)
|
||||||
"--assetsInlineLimit <number>",
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
||||||
`[number] static asset base64 inline threshold in bytes (default: 4096)`
|
.option('--assetsDir <dir>', `[string] directory under outDir to place assets in (default: assets)`)
|
||||||
).option(
|
.option('--assetsInlineLimit <number>', `[number] static asset base64 inline threshold in bytes (default: 4096)`)
|
||||||
"--ssr [entry]",
|
.option('--ssr [entry]', `[string] build specified entry for server-side rendering`)
|
||||||
`[string] build specified entry for server-side rendering`
|
.option('--sourcemap [output]', `[boolean | "inline" | "hidden"] output source maps for build (default: false)`)
|
||||||
).option(
|
.option('--minify [minifier]', `[boolean | "terser" | "esbuild"] enable/disable minification, ` +
|
||||||
"--sourcemap [output]",
|
`or specify minifier to use (default: esbuild)`)
|
||||||
`[boolean | "inline" | "hidden"] output source maps for build (default: false)`
|
.option('--manifest [name]', `[boolean | string] emit build manifest json`)
|
||||||
).option(
|
.option('--ssrManifest [name]', `[boolean | string] emit ssr manifest json`)
|
||||||
"--minify [minifier]",
|
.option('--emptyOutDir', `[boolean] force empty outDir when it's outside of root`)
|
||||||
`[boolean | "terser" | "esbuild"] enable/disable minification, or specify minifier to use (default: esbuild)`
|
.option('-w, --watch', `[boolean] rebuilds when modules have changed on disk`)
|
||||||
).option("--manifest [name]", `[boolean | string] emit build manifest json`).option("--ssrManifest [name]", `[boolean | string] emit ssr manifest json`).option(
|
.action(async (root, options) => {
|
||||||
"--emptyOutDir",
|
filterDuplicateOptions(options);
|
||||||
`[boolean] force empty outDir when it's outside of root`
|
const { build } = await import('./chunks/dep-p3C6MpSJ.js').then(function (n) { return n.F; });
|
||||||
).option("-w, --watch", `[boolean] rebuilds when modules have changed on disk`).action(async (root, options) => {
|
const buildOptions = cleanOptions(options);
|
||||||
filterDuplicateOptions(options);
|
try {
|
||||||
const { build } = await import('./chunks/dep-BK3b2jBa.js').then(function (n) { return n.G; });
|
await build({
|
||||||
const buildOptions = cleanOptions(options);
|
root,
|
||||||
try {
|
base: options.base,
|
||||||
await build({
|
mode: options.mode,
|
||||||
root,
|
configFile: options.config,
|
||||||
base: options.base,
|
logLevel: options.logLevel,
|
||||||
mode: options.mode,
|
clearScreen: options.clearScreen,
|
||||||
configFile: options.config,
|
build: buildOptions,
|
||||||
logLevel: options.logLevel,
|
});
|
||||||
clearScreen: options.clearScreen,
|
}
|
||||||
build: buildOptions
|
catch (e) {
|
||||||
});
|
createLogger(options.logLevel).error(colors.red(`error during build:\n${e.stack}`), { error: e });
|
||||||
} catch (e) {
|
process.exit(1);
|
||||||
createLogger(options.logLevel).error(
|
}
|
||||||
colors.red(`error during build:
|
finally {
|
||||||
${e.stack}`),
|
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||||
{ error: e }
|
}
|
||||||
);
|
|
||||||
process.exit(1);
|
|
||||||
} finally {
|
|
||||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
cli.command("optimize [root]", "pre-bundle dependencies").option(
|
// optimize
|
||||||
"--force",
|
cli
|
||||||
`[boolean] force the optimizer to ignore the cache and re-bundle`
|
.command('optimize [root]', 'pre-bundle dependencies')
|
||||||
).action(
|
.option('--force', `[boolean] force the optimizer to ignore the cache and re-bundle`)
|
||||||
async (root, options) => {
|
.action(async (root, options) => {
|
||||||
filterDuplicateOptions(options);
|
filterDuplicateOptions(options);
|
||||||
const { optimizeDeps } = await import('./chunks/dep-BK3b2jBa.js').then(function (n) { return n.E; });
|
const { optimizeDeps } = await import('./chunks/dep-p3C6MpSJ.js').then(function (n) { return n.D; });
|
||||||
try {
|
try {
|
||||||
const config = await resolveConfig(
|
const config = await resolveConfig({
|
||||||
{
|
root,
|
||||||
root,
|
base: options.base,
|
||||||
base: options.base,
|
configFile: options.config,
|
||||||
configFile: options.config,
|
logLevel: options.logLevel,
|
||||||
logLevel: options.logLevel,
|
mode: options.mode,
|
||||||
mode: options.mode
|
}, 'serve');
|
||||||
},
|
await optimizeDeps(config, options.force, true);
|
||||||
"serve"
|
|
||||||
);
|
|
||||||
await optimizeDeps(config, options.force, true);
|
|
||||||
} catch (e) {
|
|
||||||
createLogger(options.logLevel).error(
|
|
||||||
colors.red(`error when optimizing deps:
|
|
||||||
${e.stack}`),
|
|
||||||
{ error: e }
|
|
||||||
);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
}
|
catch (e) {
|
||||||
);
|
createLogger(options.logLevel).error(colors.red(`error when optimizing deps:\n${e.stack}`), { error: e });
|
||||||
cli.command("preview [root]", "locally preview production build").option("--host [host]", `[string] specify hostname`, { type: [convertHost] }).option("--port <port>", `[number] specify port`).option("--strictPort", `[boolean] exit if specified port is already in use`).option("--open [path]", `[boolean | string] open browser on startup`).option("--outDir <dir>", `[string] output directory (default: dist)`).action(
|
process.exit(1);
|
||||||
async (root, options) => {
|
}
|
||||||
|
});
|
||||||
|
// preview
|
||||||
|
cli
|
||||||
|
.command('preview [root]', 'locally preview production build')
|
||||||
|
.option('--host [host]', `[string] specify hostname`, { type: [convertHost] })
|
||||||
|
.option('--port <port>', `[number] specify port`)
|
||||||
|
.option('--strictPort', `[boolean] exit if specified port is already in use`)
|
||||||
|
.option('--open [path]', `[boolean | string] open browser on startup`)
|
||||||
|
.option('--outDir <dir>', `[string] output directory (default: dist)`)
|
||||||
|
.action(async (root, options) => {
|
||||||
filterDuplicateOptions(options);
|
filterDuplicateOptions(options);
|
||||||
const { preview } = await import('./chunks/dep-BK3b2jBa.js').then(function (n) { return n.H; });
|
const { preview } = await import('./chunks/dep-p3C6MpSJ.js').then(function (n) { return n.G; });
|
||||||
try {
|
try {
|
||||||
const server = await preview({
|
const server = await preview({
|
||||||
root,
|
root,
|
||||||
base: options.base,
|
base: options.base,
|
||||||
configFile: options.config,
|
configFile: options.config,
|
||||||
logLevel: options.logLevel,
|
logLevel: options.logLevel,
|
||||||
mode: options.mode,
|
mode: options.mode,
|
||||||
build: {
|
build: {
|
||||||
outDir: options.outDir
|
outDir: options.outDir,
|
||||||
},
|
},
|
||||||
preview: {
|
preview: {
|
||||||
port: options.port,
|
port: options.port,
|
||||||
strictPort: options.strictPort,
|
strictPort: options.strictPort,
|
||||||
host: options.host,
|
host: options.host,
|
||||||
open: options.open
|
open: options.open,
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
server.printUrls();
|
server.printUrls();
|
||||||
server.bindCLIShortcuts({ print: true });
|
server.bindCLIShortcuts({ print: true });
|
||||||
} catch (e) {
|
|
||||||
createLogger(options.logLevel).error(
|
|
||||||
colors.red(`error when starting preview server:
|
|
||||||
${e.stack}`),
|
|
||||||
{ error: e }
|
|
||||||
);
|
|
||||||
process.exit(1);
|
|
||||||
} finally {
|
|
||||||
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
|
||||||
}
|
}
|
||||||
}
|
catch (e) {
|
||||||
);
|
createLogger(options.logLevel).error(colors.red(`error when starting preview server:\n${e.stack}`), { error: e });
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
stopProfiler((message) => createLogger(options.logLevel).info(message));
|
||||||
|
}
|
||||||
|
});
|
||||||
cli.help();
|
cli.help();
|
||||||
cli.version(VERSION);
|
cli.version(VERSION);
|
||||||
cli.parse();
|
cli.parse();
|
||||||
|
|
|
||||||
|
|
@ -2,112 +2,114 @@ import path, { resolve } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { readFileSync } from 'node:fs';
|
import { readFileSync } from 'node:fs';
|
||||||
|
|
||||||
const { version } = JSON.parse(
|
const { version } = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url)).toString());
|
||||||
readFileSync(new URL("../../package.json", import.meta.url)).toString()
|
|
||||||
);
|
|
||||||
const VERSION = version;
|
const VERSION = version;
|
||||||
const DEFAULT_MAIN_FIELDS = [
|
const DEFAULT_MAIN_FIELDS = [
|
||||||
"browser",
|
'browser',
|
||||||
"module",
|
'module',
|
||||||
"jsnext:main",
|
'jsnext:main',
|
||||||
// moment still uses this...
|
'jsnext',
|
||||||
"jsnext"
|
|
||||||
];
|
];
|
||||||
|
// Baseline support browserslist
|
||||||
|
// "defaults and supports es6-module and supports es6-module-dynamic-import"
|
||||||
|
// Higher browser versions may be needed for extra features.
|
||||||
const ESBUILD_MODULES_TARGET = [
|
const ESBUILD_MODULES_TARGET = [
|
||||||
"es2020",
|
'es2020',
|
||||||
// support import.meta.url
|
'edge88',
|
||||||
"edge88",
|
'firefox78',
|
||||||
"firefox78",
|
'chrome87',
|
||||||
"chrome87",
|
'safari14',
|
||||||
"safari14"
|
|
||||||
];
|
];
|
||||||
const DEFAULT_EXTENSIONS = [
|
const DEFAULT_EXTENSIONS = [
|
||||||
".mjs",
|
'.mjs',
|
||||||
".js",
|
'.js',
|
||||||
".mts",
|
'.mts',
|
||||||
".ts",
|
'.ts',
|
||||||
".jsx",
|
'.jsx',
|
||||||
".tsx",
|
'.tsx',
|
||||||
".json"
|
'.json',
|
||||||
];
|
];
|
||||||
const DEFAULT_CONFIG_FILES = [
|
const DEFAULT_CONFIG_FILES = [
|
||||||
"vite.config.js",
|
'vite.config.js',
|
||||||
"vite.config.mjs",
|
'vite.config.mjs',
|
||||||
"vite.config.ts",
|
'vite.config.ts',
|
||||||
"vite.config.cjs",
|
'vite.config.cjs',
|
||||||
"vite.config.mts",
|
'vite.config.mts',
|
||||||
"vite.config.cts"
|
'vite.config.cts',
|
||||||
];
|
];
|
||||||
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
const JS_TYPES_RE = /\.(?:j|t)sx?$|\.mjs$/;
|
||||||
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
const CSS_LANGS_RE = /\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
||||||
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
|
const OPTIMIZABLE_ENTRY_RE = /\.[cm]?[jt]s$/;
|
||||||
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
|
const SPECIAL_QUERY_RE = /[?&](?:worker|sharedworker|raw|url)\b/;
|
||||||
|
/**
|
||||||
|
* Prefix for resolved fs paths, since windows paths may not be valid as URLs.
|
||||||
|
*/
|
||||||
const FS_PREFIX = `/@fs/`;
|
const FS_PREFIX = `/@fs/`;
|
||||||
const CLIENT_PUBLIC_PATH = `/@vite/client`;
|
const CLIENT_PUBLIC_PATH = `/@vite/client`;
|
||||||
const ENV_PUBLIC_PATH = `/@vite/env`;
|
const ENV_PUBLIC_PATH = `/@vite/env`;
|
||||||
const VITE_PACKAGE_DIR = resolve(
|
const VITE_PACKAGE_DIR = resolve(
|
||||||
// import.meta.url is `dist/node/constants.js` after bundle
|
// import.meta.url is `dist/node/constants.js` after bundle
|
||||||
fileURLToPath(import.meta.url),
|
fileURLToPath(import.meta.url), '../../..');
|
||||||
"../../.."
|
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/client.mjs');
|
||||||
);
|
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, 'dist/client/env.mjs');
|
||||||
const CLIENT_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/client.mjs");
|
|
||||||
const ENV_ENTRY = resolve(VITE_PACKAGE_DIR, "dist/client/env.mjs");
|
|
||||||
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
|
const CLIENT_DIR = path.dirname(CLIENT_ENTRY);
|
||||||
|
// ** READ THIS ** before editing `KNOWN_ASSET_TYPES`.
|
||||||
|
// If you add an asset to `KNOWN_ASSET_TYPES`, make sure to also add it
|
||||||
|
// to the TypeScript declaration file `packages/vite/client.d.ts` and
|
||||||
|
// add a mime type to the `registerCustomMime` in
|
||||||
|
// `packages/vite/src/node/plugin/assets.ts` if mime type cannot be
|
||||||
|
// looked up by mrmime.
|
||||||
const KNOWN_ASSET_TYPES = [
|
const KNOWN_ASSET_TYPES = [
|
||||||
// images
|
// images
|
||||||
"apng",
|
'apng',
|
||||||
"bmp",
|
'png',
|
||||||
"png",
|
'jpe?g',
|
||||||
"jpe?g",
|
'jfif',
|
||||||
"jfif",
|
'pjpeg',
|
||||||
"pjpeg",
|
'pjp',
|
||||||
"pjp",
|
'gif',
|
||||||
"gif",
|
'svg',
|
||||||
"svg",
|
'ico',
|
||||||
"ico",
|
'webp',
|
||||||
"webp",
|
'avif',
|
||||||
"avif",
|
// media
|
||||||
// media
|
'mp4',
|
||||||
"mp4",
|
'webm',
|
||||||
"webm",
|
'ogg',
|
||||||
"ogg",
|
'mp3',
|
||||||
"mp3",
|
'wav',
|
||||||
"wav",
|
'flac',
|
||||||
"flac",
|
'aac',
|
||||||
"aac",
|
'opus',
|
||||||
"opus",
|
'mov',
|
||||||
"mov",
|
'm4a',
|
||||||
"m4a",
|
'vtt',
|
||||||
"vtt",
|
// fonts
|
||||||
// fonts
|
'woff2?',
|
||||||
"woff2?",
|
'eot',
|
||||||
"eot",
|
'ttf',
|
||||||
"ttf",
|
'otf',
|
||||||
"otf",
|
// other
|
||||||
// other
|
'webmanifest',
|
||||||
"webmanifest",
|
'pdf',
|
||||||
"pdf",
|
'txt',
|
||||||
"txt"
|
|
||||||
];
|
];
|
||||||
const DEFAULT_ASSETS_RE = new RegExp(
|
const DEFAULT_ASSETS_RE = new RegExp(`\\.(` + KNOWN_ASSET_TYPES.join('|') + `)(\\?.*)?$`);
|
||||||
`\\.(` + KNOWN_ASSET_TYPES.join("|") + `)(\\?.*)?$`
|
|
||||||
);
|
|
||||||
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
|
const DEP_VERSION_RE = /[?&](v=[\w.-]+)\b/;
|
||||||
const loopbackHosts = /* @__PURE__ */ new Set([
|
const loopbackHosts = new Set([
|
||||||
"localhost",
|
'localhost',
|
||||||
"127.0.0.1",
|
'127.0.0.1',
|
||||||
"::1",
|
'::1',
|
||||||
"0000:0000:0000:0000:0000:0000:0000:0001"
|
'0000:0000:0000:0000:0000:0000:0000:0001',
|
||||||
]);
|
]);
|
||||||
const wildcardHosts = /* @__PURE__ */ new Set([
|
const wildcardHosts = new Set([
|
||||||
"0.0.0.0",
|
'0.0.0.0',
|
||||||
"::",
|
'::',
|
||||||
"0000:0000:0000:0000:0000:0000:0000:0000"
|
'0000:0000:0000:0000:0000:0000:0000:0000',
|
||||||
]);
|
]);
|
||||||
const DEFAULT_DEV_PORT = 5173;
|
const DEFAULT_DEV_PORT = 5173;
|
||||||
const DEFAULT_PREVIEW_PORT = 4173;
|
const DEFAULT_PREVIEW_PORT = 4173;
|
||||||
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
const DEFAULT_ASSETS_INLINE_LIMIT = 4096;
|
||||||
const defaultAllowedOrigins = /^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/;
|
const METADATA_FILENAME = '_metadata.json';
|
||||||
const METADATA_FILENAME = "_metadata.json";
|
|
||||||
|
|
||||||
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, defaultAllowedOrigins, loopbackHosts, wildcardHosts };
|
export { CLIENT_DIR, CLIENT_ENTRY, CLIENT_PUBLIC_PATH, CSS_LANGS_RE, DEFAULT_ASSETS_INLINE_LIMIT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES, DEFAULT_DEV_PORT, DEFAULT_EXTENSIONS, DEFAULT_MAIN_FIELDS, DEFAULT_PREVIEW_PORT, DEP_VERSION_RE, ENV_ENTRY, ENV_PUBLIC_PATH, ESBUILD_MODULES_TARGET, FS_PREFIX, JS_TYPES_RE, KNOWN_ASSET_TYPES, METADATA_FILENAME, OPTIMIZABLE_ENTRY_RE, SPECIAL_QUERY_RE, VERSION, VITE_PACKAGE_DIR, loopbackHosts, wildcardHosts };
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
import { PluginHooks, RollupError, SourceMap, ModuleInfo, PartialResolvedId, MinimalPluginContext, InputOptions, CustomPluginOptions, LoadResult, SourceDescription, RollupOptions, WatcherOptions, InputOption, ModuleFormat, RollupOutput, RollupWatcher, SourceMapInput, ExistingRawSourceMap, OutputBundle, OutputChunk, ObjectHook, PluginContext, ResolveIdResult, TransformPluginContext, GetManualChunk } from 'rollup';
|
import { PluginHooks, RollupError, SourceMap, ModuleInfo, PartialResolvedId, InputOptions, CustomPluginOptions, SourceDescription, LoadResult, RollupOptions, WatcherOptions, InputOption, ModuleFormat, RollupOutput, RollupWatcher, SourceMapInput, ExistingRawSourceMap, OutputBundle, OutputChunk, ObjectHook, PluginContext, ResolveIdResult, TransformPluginContext, GetManualChunk } from 'rollup';
|
||||||
import * as rollup from 'rollup';
|
import * as rollup from 'rollup';
|
||||||
export { rollup as Rollup };
|
export { rollup as Rollup };
|
||||||
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
||||||
|
|
@ -414,7 +414,6 @@ declare namespace HttpProxy {
|
||||||
* @param req - Client request.
|
* @param req - Client request.
|
||||||
* @param res - Client response.
|
* @param res - Client response.
|
||||||
* @param options - Additional options.
|
* @param options - Additional options.
|
||||||
* @param callback - Error callback.
|
|
||||||
*/
|
*/
|
||||||
web(
|
web(
|
||||||
req: http.IncomingMessage,
|
req: http.IncomingMessage,
|
||||||
|
|
@ -429,7 +428,6 @@ declare namespace HttpProxy {
|
||||||
* @param socket - Client socket.
|
* @param socket - Client socket.
|
||||||
* @param head - Client head.
|
* @param head - Client head.
|
||||||
* @param options - Additional options.
|
* @param options - Additional options.
|
||||||
* @param callback - Error callback.
|
|
||||||
*/
|
*/
|
||||||
ws(
|
ws(
|
||||||
req: http.IncomingMessage,
|
req: http.IncomingMessage,
|
||||||
|
|
@ -620,12 +618,6 @@ interface ProxyOptions extends HttpProxy.ServerOptions {
|
||||||
* webpack-dev-server style bypass function
|
* webpack-dev-server style bypass function
|
||||||
*/
|
*/
|
||||||
bypass?: (req: http.IncomingMessage, res: http.ServerResponse, options: ProxyOptions) => void | null | undefined | false | string;
|
bypass?: (req: http.IncomingMessage, res: http.ServerResponse, options: ProxyOptions) => void | null | undefined | false | string;
|
||||||
/**
|
|
||||||
* rewrite the Origin header of a WebSocket request to match the the target
|
|
||||||
*
|
|
||||||
* **Exercise caution as rewriting the Origin can leave the proxying open to [CSRF attacks](https://owasp.org/www-community/attacks/csrf).**
|
|
||||||
*/
|
|
||||||
rewriteWsOrigin?: boolean | undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type LogType = 'error' | 'warn' | 'info';
|
type LogType = 'error' | 'warn' | 'info';
|
||||||
|
|
@ -669,18 +661,6 @@ interface CommonServerOptions {
|
||||||
* Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
|
* Set to 0.0.0.0 to listen on all addresses, including LAN and public addresses.
|
||||||
*/
|
*/
|
||||||
host?: string | boolean;
|
host?: string | boolean;
|
||||||
/**
|
|
||||||
* The hostnames that Vite is allowed to respond to.
|
|
||||||
* `localhost` and subdomains under `.localhost` and all IP addresses are allowed by default.
|
|
||||||
* When using HTTPS, this check is skipped.
|
|
||||||
*
|
|
||||||
* If a string starts with `.`, it will allow that hostname without the `.` and all subdomains under the hostname.
|
|
||||||
* For example, `.example.com` will allow `example.com`, `foo.example.com`, and `foo.bar.example.com`.
|
|
||||||
*
|
|
||||||
* If set to `true`, the server is allowed to respond to requests for any hosts.
|
|
||||||
* This is not recommended as it will be vulnerable to DNS rebinding attacks.
|
|
||||||
*/
|
|
||||||
allowedHosts?: string[] | true;
|
|
||||||
/**
|
/**
|
||||||
* Enable TLS + HTTP/2.
|
* Enable TLS + HTTP/2.
|
||||||
* Note: this downgrades to TLS only when the proxy option is also used.
|
* Note: this downgrades to TLS only when the proxy option is also used.
|
||||||
|
|
@ -716,14 +696,8 @@ interface CommonServerOptions {
|
||||||
/**
|
/**
|
||||||
* Configure CORS for the dev server.
|
* Configure CORS for the dev server.
|
||||||
* Uses https://github.com/expressjs/cors.
|
* Uses https://github.com/expressjs/cors.
|
||||||
*
|
|
||||||
* When enabling this option, **we recommend setting a specific value
|
|
||||||
* rather than `true`** to avoid exposing the source code to untrusted origins.
|
|
||||||
*
|
|
||||||
* Set to `true` to allow all methods from any origin, or configure separately
|
* Set to `true` to allow all methods from any origin, or configure separately
|
||||||
* using an object.
|
* using an object.
|
||||||
*
|
|
||||||
* @default false
|
|
||||||
*/
|
*/
|
||||||
cors?: CorsOptions | boolean;
|
cors?: CorsOptions | boolean;
|
||||||
/**
|
/**
|
||||||
|
|
@ -735,13 +709,7 @@ interface CommonServerOptions {
|
||||||
* https://github.com/expressjs/cors#configuration-options
|
* https://github.com/expressjs/cors#configuration-options
|
||||||
*/
|
*/
|
||||||
interface CorsOptions {
|
interface CorsOptions {
|
||||||
/**
|
origin?: CorsOrigin | ((origin: string, cb: (err: Error, origins: CorsOrigin) => void) => void);
|
||||||
* Configures the Access-Control-Allow-Origin CORS header.
|
|
||||||
*
|
|
||||||
* **We recommend setting a specific value rather than
|
|
||||||
* `true`** to avoid exposing the source code to untrusted origins.
|
|
||||||
*/
|
|
||||||
origin?: CorsOrigin | ((origin: string | undefined, cb: (err: Error, origins: CorsOrigin) => void) => void);
|
|
||||||
methods?: string | string[];
|
methods?: string | string[];
|
||||||
allowedHeaders?: string | string[];
|
allowedHeaders?: string | string[];
|
||||||
exposedHeaders?: string | string[];
|
exposedHeaders?: string | string[];
|
||||||
|
|
@ -905,50 +873,29 @@ declare class ModuleGraph {
|
||||||
* https://github.com/preactjs/wmr/blob/main/packages/wmr/src/lib/rollup-plugin-container.js
|
* https://github.com/preactjs/wmr/blob/main/packages/wmr/src/lib/rollup-plugin-container.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
declare class PluginContainer {
|
interface PluginContainer {
|
||||||
config: ResolvedConfig;
|
options: InputOptions;
|
||||||
moduleGraph?: ModuleGraph | undefined;
|
|
||||||
watcher?: FSWatcher | undefined;
|
|
||||||
plugins: readonly Plugin<any>[];
|
|
||||||
private _pluginContextMap;
|
|
||||||
private _pluginContextMapSsr;
|
|
||||||
private _resolvedRollupOptions?;
|
|
||||||
private _processesing;
|
|
||||||
private _seenResolves;
|
|
||||||
private _closed;
|
|
||||||
private _moduleNodeToLoadAddedImports;
|
|
||||||
getSortedPluginHooks: PluginHookUtils['getSortedPluginHooks'];
|
|
||||||
getSortedPlugins: PluginHookUtils['getSortedPlugins'];
|
|
||||||
watchFiles: Set<string>;
|
|
||||||
minimalContext: MinimalPluginContext;
|
|
||||||
private _updateModuleLoadAddedImports;
|
|
||||||
private _getAddedImports;
|
|
||||||
getModuleInfo(id: string): ModuleInfo | null;
|
getModuleInfo(id: string): ModuleInfo | null;
|
||||||
private handleHookPromise;
|
buildStart(options: InputOptions): Promise<void>;
|
||||||
get options(): InputOptions;
|
resolveId(id: string, importer?: string, options?: {
|
||||||
resolveRollupOptions(): Promise<InputOptions>;
|
|
||||||
private _getPluginContext;
|
|
||||||
private hookParallel;
|
|
||||||
buildStart(_options?: InputOptions): Promise<void>;
|
|
||||||
resolveId(rawId: string, importer?: string | undefined, options?: {
|
|
||||||
attributes?: Record<string, string>;
|
attributes?: Record<string, string>;
|
||||||
custom?: CustomPluginOptions;
|
custom?: CustomPluginOptions;
|
||||||
skip?: Set<Plugin>;
|
skip?: Set<Plugin>;
|
||||||
ssr?: boolean;
|
ssr?: boolean;
|
||||||
isEntry?: boolean;
|
isEntry?: boolean;
|
||||||
}): Promise<PartialResolvedId | null>;
|
}): Promise<PartialResolvedId | null>;
|
||||||
load(id: string, options?: {
|
|
||||||
ssr?: boolean;
|
|
||||||
}): Promise<LoadResult | null>;
|
|
||||||
transform(code: string, id: string, options?: {
|
transform(code: string, id: string, options?: {
|
||||||
ssr?: boolean;
|
|
||||||
inMap?: SourceDescription['map'];
|
inMap?: SourceDescription['map'];
|
||||||
|
ssr?: boolean;
|
||||||
}): Promise<{
|
}): Promise<{
|
||||||
code: string;
|
code: string;
|
||||||
map: SourceMap | {
|
map: SourceMap | {
|
||||||
mappings: '';
|
mappings: '';
|
||||||
} | null;
|
} | null;
|
||||||
}>;
|
}>;
|
||||||
|
load(id: string, options?: {
|
||||||
|
ssr?: boolean;
|
||||||
|
}): Promise<LoadResult | null>;
|
||||||
watchChange(id: string, change: {
|
watchChange(id: string, change: {
|
||||||
event: 'create' | 'update' | 'delete';
|
event: 'create' | 'update' | 'delete';
|
||||||
}): Promise<void>;
|
}): Promise<void>;
|
||||||
|
|
@ -960,7 +907,6 @@ declare class PluginContainer {
|
||||||
|
|
||||||
declare const WebSocketAlias: typeof WebSocket
|
declare const WebSocketAlias: typeof WebSocket
|
||||||
interface WebSocketAlias extends WebSocket {}
|
interface WebSocketAlias extends WebSocket {}
|
||||||
|
|
||||||
// WebSocket socket.
|
// WebSocket socket.
|
||||||
declare class WebSocket extends EventEmitter {
|
declare class WebSocket extends EventEmitter {
|
||||||
/** The connection is not yet open. */
|
/** The connection is not yet open. */
|
||||||
|
|
@ -1229,6 +1175,7 @@ declare class WebSocket extends EventEmitter {
|
||||||
listener: (...args: any[]) => void,
|
listener: (...args: any[]) => void,
|
||||||
): this
|
): this
|
||||||
}
|
}
|
||||||
|
// tslint:disable-line no-empty-interface
|
||||||
|
|
||||||
declare namespace WebSocket {
|
declare namespace WebSocket {
|
||||||
/**
|
/**
|
||||||
|
|
@ -1478,9 +1425,9 @@ declare namespace WebSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
const WebSocketServer: typeof Server
|
const WebSocketServer: typeof Server
|
||||||
interface WebSocketServer extends Server {}
|
interface WebSocketServer extends Server {} // tslint:disable-line no-empty-interface
|
||||||
const WebSocket: typeof WebSocketAlias
|
const WebSocket: typeof WebSocketAlias
|
||||||
interface WebSocket extends WebSocketAlias {}
|
interface WebSocket extends WebSocketAlias {} // tslint:disable-line no-empty-interface
|
||||||
|
|
||||||
// WebSocket stream
|
// WebSocket stream
|
||||||
function createWebSocketStream(
|
function createWebSocketStream(
|
||||||
|
|
@ -1497,7 +1444,7 @@ interface HmrOptions {
|
||||||
path?: string;
|
path?: string;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
overlay?: boolean;
|
overlay?: boolean;
|
||||||
server?: HttpServer;
|
server?: Server;
|
||||||
}
|
}
|
||||||
interface HmrContext {
|
interface HmrContext {
|
||||||
file: string;
|
file: string;
|
||||||
|
|
@ -1613,11 +1560,6 @@ interface ServerOptions extends CommonServerOptions {
|
||||||
* Configure HMR-specific options (port, host, path & protocol)
|
* Configure HMR-specific options (port, host, path & protocol)
|
||||||
*/
|
*/
|
||||||
hmr?: HmrOptions | boolean;
|
hmr?: HmrOptions | boolean;
|
||||||
/**
|
|
||||||
* Do not start the websocket connection.
|
|
||||||
* @experimental
|
|
||||||
*/
|
|
||||||
ws?: false;
|
|
||||||
/**
|
/**
|
||||||
* Warm-up files to transform and cache the results in advance. This improves the
|
* Warm-up files to transform and cache the results in advance. This improves the
|
||||||
* initial page load during server starts and prevents transform waterfalls.
|
* initial page load during server starts and prevents transform waterfalls.
|
||||||
|
|
@ -1647,7 +1589,7 @@ interface ServerOptions extends CommonServerOptions {
|
||||||
*
|
*
|
||||||
* This is needed to proxy WebSocket connections to the parent server.
|
* This is needed to proxy WebSocket connections to the parent server.
|
||||||
*/
|
*/
|
||||||
server: HttpServer;
|
server: http.Server;
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
* Options for files served via '/\@fs/'.
|
* Options for files served via '/\@fs/'.
|
||||||
|
|
@ -2122,9 +2064,6 @@ interface RollupDynamicImportVarsOptions {
|
||||||
declare namespace Terser {
|
declare namespace Terser {
|
||||||
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
export type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020
|
||||||
|
|
||||||
export type ConsoleProperty = keyof typeof console
|
|
||||||
type DropConsoleOption = boolean | ConsoleProperty[]
|
|
||||||
|
|
||||||
export interface ParseOptions {
|
export interface ParseOptions {
|
||||||
bare_returns?: boolean
|
bare_returns?: boolean
|
||||||
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
|
||||||
|
|
@ -2145,7 +2084,7 @@ declare namespace Terser {
|
||||||
dead_code?: boolean
|
dead_code?: boolean
|
||||||
defaults?: boolean
|
defaults?: boolean
|
||||||
directives?: boolean
|
directives?: boolean
|
||||||
drop_console?: DropConsoleOption
|
drop_console?: boolean
|
||||||
drop_debugger?: boolean
|
drop_debugger?: boolean
|
||||||
ecma?: ECMA
|
ecma?: ECMA
|
||||||
evaluate?: boolean
|
evaluate?: boolean
|
||||||
|
|
@ -2168,7 +2107,6 @@ declare namespace Terser {
|
||||||
passes?: number
|
passes?: number
|
||||||
properties?: boolean
|
properties?: boolean
|
||||||
pure_funcs?: string[]
|
pure_funcs?: string[]
|
||||||
pure_new?: boolean
|
|
||||||
pure_getters?: boolean | 'strict'
|
pure_getters?: boolean | 'strict'
|
||||||
reduce_funcs?: boolean
|
reduce_funcs?: boolean
|
||||||
reduce_vars?: boolean
|
reduce_vars?: boolean
|
||||||
|
|
@ -2218,7 +2156,7 @@ declare namespace Terser {
|
||||||
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
|
||||||
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
|
||||||
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
|
||||||
* @param n The ordinal of the identifier.
|
* @param n - The ordinal of the identifier.
|
||||||
*/
|
*/
|
||||||
get(n: number): string
|
get(n: number): string
|
||||||
}
|
}
|
||||||
|
|
@ -2230,8 +2168,8 @@ declare namespace Terser {
|
||||||
/**
|
/**
|
||||||
* Modifies the internal weighting of the input characters by the specified delta.
|
* Modifies the internal weighting of the input characters by the specified delta.
|
||||||
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
|
||||||
* @param chars The characters to modify the weighting of.
|
* @param chars - The characters to modify the weighting of.
|
||||||
* @param delta The numeric weight to add to the characters.
|
* @param delta - The numeric weight to add to the characters.
|
||||||
*/
|
*/
|
||||||
consider(chars: string, delta: number): number
|
consider(chars: string, delta: number): number
|
||||||
/**
|
/**
|
||||||
|
|
@ -2314,7 +2252,7 @@ declare namespace Terser {
|
||||||
module?: boolean
|
module?: boolean
|
||||||
nameCache?: object
|
nameCache?: object
|
||||||
format?: FormatOptions
|
format?: FormatOptions
|
||||||
/** @deprecated */
|
/** @deprecated deprecated */
|
||||||
output?: FormatOptions
|
output?: FormatOptions
|
||||||
parse?: ParseOptions
|
parse?: ParseOptions
|
||||||
safari10?: boolean
|
safari10?: boolean
|
||||||
|
|
@ -2334,7 +2272,6 @@ declare namespace Terser {
|
||||||
includeSources?: boolean
|
includeSources?: boolean
|
||||||
filename?: string
|
filename?: string
|
||||||
root?: string
|
root?: string
|
||||||
asObject?: boolean
|
|
||||||
url?: string | 'inline'
|
url?: string | 'inline'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -2556,7 +2493,7 @@ interface LibraryOptions {
|
||||||
*/
|
*/
|
||||||
fileName?: string | ((format: ModuleFormat, entryName: string) => string);
|
fileName?: string | ((format: ModuleFormat, entryName: string) => string);
|
||||||
}
|
}
|
||||||
type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife' | 'system';
|
type LibraryFormats = 'es' | 'cjs' | 'umd' | 'iife';
|
||||||
interface ModulePreloadOptions {
|
interface ModulePreloadOptions {
|
||||||
/**
|
/**
|
||||||
* Whether to inject a module preload polyfill.
|
* Whether to inject a module preload polyfill.
|
||||||
|
|
@ -2687,7 +2624,7 @@ interface DepOptimizationConfig {
|
||||||
* When enabled, it will hold the first optimized deps results until all static
|
* When enabled, it will hold the first optimized deps results until all static
|
||||||
* imports are crawled on cold start. This avoids the need for full-page reloads
|
* imports are crawled on cold start. This avoids the need for full-page reloads
|
||||||
* when new dependencies are discovered and they trigger the generation of new
|
* when new dependencies are discovered and they trigger the generation of new
|
||||||
* common chunks. If all dependencies are found by the scanner plus the explicitly
|
* common chunks. If all dependencies are found by the scanner plus the explicitely
|
||||||
* defined ones in `include`, it is better to disable this option to let the
|
* defined ones in `include`, it is better to disable this option to let the
|
||||||
* browser process more requests in parallel.
|
* browser process more requests in parallel.
|
||||||
* @default true
|
* @default true
|
||||||
|
|
@ -2923,7 +2860,6 @@ type LightningCSSOptions = {
|
||||||
pseudoClasses?: PseudoClasses
|
pseudoClasses?: PseudoClasses
|
||||||
unusedSymbols?: string[]
|
unusedSymbols?: string[]
|
||||||
cssModules?: CSSModulesConfig
|
cssModules?: CSSModulesConfig
|
||||||
errorRecovery?: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CSSOptions {
|
interface CSSOptions {
|
||||||
|
|
@ -3426,18 +3362,6 @@ interface LegacyOptions {
|
||||||
* https://github.com/vitejs/vite/discussions/14697.
|
* https://github.com/vitejs/vite/discussions/14697.
|
||||||
*/
|
*/
|
||||||
proxySsrExternalModules?: boolean;
|
proxySsrExternalModules?: boolean;
|
||||||
/**
|
|
||||||
* In Vite 6.0.8 / 5.4.11 and below, WebSocket server was able to connect from any web pages. However,
|
|
||||||
* that could be exploited by a malicious web page.
|
|
||||||
*
|
|
||||||
* In Vite 6.0.9+ / 5.4.12+, the WebSocket server now requires a token to connect from a web page.
|
|
||||||
* But this may break some plugins and frameworks that connects to the WebSocket server
|
|
||||||
* on their own. Enabling this option will make Vite skip the token check.
|
|
||||||
*
|
|
||||||
* **We do not recommend enabling this option unless you are sure that you are fine with
|
|
||||||
* that security weakness.**
|
|
||||||
*/
|
|
||||||
skipWebSocketTokenCheck?: boolean;
|
|
||||||
}
|
}
|
||||||
interface ResolvedWorkerOptions {
|
interface ResolvedWorkerOptions {
|
||||||
format: 'es' | 'iife';
|
format: 'es' | 'iife';
|
||||||
|
|
@ -3479,17 +3403,6 @@ type ResolvedConfig = Readonly<Omit<UserConfig, 'plugins' | 'css' | 'assetsInclu
|
||||||
worker: ResolvedWorkerOptions;
|
worker: ResolvedWorkerOptions;
|
||||||
appType: AppType;
|
appType: AppType;
|
||||||
experimental: ExperimentalOptions;
|
experimental: ExperimentalOptions;
|
||||||
/**
|
|
||||||
* The token to connect to the WebSocket server from browsers.
|
|
||||||
*
|
|
||||||
* We recommend using `import.meta.hot` rather than connecting
|
|
||||||
* to the WebSocket server directly.
|
|
||||||
* If you have a usecase that requires connecting to the WebSocket
|
|
||||||
* server, please create an issue so that we can discuss.
|
|
||||||
*
|
|
||||||
* @deprecated
|
|
||||||
*/
|
|
||||||
webSocketToken: string;
|
|
||||||
} & PluginHookUtils>;
|
} & PluginHookUtils>;
|
||||||
interface PluginHookUtils {
|
interface PluginHookUtils {
|
||||||
getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
|
getSortedPlugins: <K extends keyof Plugin>(hookName: K) => PluginWithRequiredHook<K>[];
|
||||||
|
|
@ -3567,10 +3480,8 @@ declare function searchForWorkspaceRoot(current: string, root?: string): string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the url is allowed to be served, via the `server.fs` config.
|
* Check if the url is allowed to be served, via the `server.fs` config.
|
||||||
* @deprecated Use the `isFileLoadingAllowed` function instead.
|
|
||||||
*/
|
*/
|
||||||
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
declare function isFileServingAllowed(url: string, server: ViteDevServer): boolean;
|
||||||
declare function isFileLoadingAllowed(server: ViteDevServer, filePath: string): boolean;
|
|
||||||
|
|
||||||
declare function loadEnv(mode: string, envDir: string, prefixes?: string | string[]): Record<string, string>;
|
declare function loadEnv(mode: string, envDir: string, prefixes?: string | string[]): Record<string, string>;
|
||||||
declare function resolveEnvPrefix({ envPrefix, }: UserConfig): string[];
|
declare function resolveEnvPrefix({ envPrefix, }: UserConfig): string[];
|
||||||
|
|
@ -3624,4 +3535,4 @@ declare class ServerHMRConnector implements HMRRuntimeConnection {
|
||||||
onUpdate(handler: (payload: HMRPayload) => void): void;
|
onUpdate(handler: (payload: HMRPayload) => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HtmlTagDescriptor, HttpProxy, type HttpServer, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileLoadingAllowed, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
|
export { type Alias, type AliasOptions, type AnymatchFn, type AnymatchPattern, type AppType, type AwaitWriteFinishOptions, type BindCLIShortcutsOptions, type BuildOptions, type CLIShortcut, type CSSModulesOptions, type CSSOptions, type CommonServerOptions, type ConfigEnv, Connect, type CorsOptions, type CorsOrigin, type DepOptimizationConfig, type DepOptimizationMetadata, type DepOptimizationOptions, type ESBuildOptions, type ESBuildTransformResult, type ExperimentalOptions, type ExportsData, FSWatcher, type FetchModuleOptions, type FileSystemServeOptions, type FilterPattern, type HMRBroadcaster, type HMRBroadcasterClient, type HMRChannel, type HTMLOptions, type HmrContext, type HmrOptions, type HookHandler, type HtmlTagDescriptor, HttpProxy, type IndexHtmlTransform, type IndexHtmlTransformContext, type IndexHtmlTransformHook, type IndexHtmlTransformResult, type InlineConfig, type InternalResolveOptions, type JsonOptions, type LegacyOptions, type LibraryFormats, type LibraryOptions, type LightningCSSOptions, type LogErrorOptions, type LogLevel, type LogOptions, type LogType, type Logger, type LoggerOptions, type MainThreadRuntimeOptions, type Manifest, type ManifestChunk, type MapToFunction, type AnymatchMatcher as Matcher, ModuleGraph, ModuleNode, type ModulePreloadOptions, type OptimizedDepInfo, type Plugin, type PluginContainer, type PluginHookUtils, type PluginOption, type PreprocessCSSResult, type PreviewOptions, type PreviewServer, type PreviewServerHook, type ProxyOptions, type RenderBuiltAssetUrl, type ResolveFn, type ResolveModulePreloadDependenciesFn, type ResolveOptions, type ResolvedBuildOptions, type ResolvedCSSOptions, type ResolvedConfig, type ResolvedModulePreloadOptions, type ResolvedPreviewOptions, type ResolvedSSROptions, type ResolvedServerOptions, type ResolvedServerUrls, type ResolvedUrl, type ResolvedWorkerOptions, type ResolverFunction, type ResolverObject, type RollupCommonJSOptions, type RollupDynamicImportVarsOptions, type SSROptions, type SSRTarget, type SendOptions, type ServerHMRChannel, ServerHMRConnector, type ServerHook, type ServerOptions, SplitVendorChunkCache, type SsrDepOptimizationOptions, Terser, type TerserOptions, type TransformOptions, type TransformResult, type UserConfig, type UserConfigExport, type UserConfigFn, type UserConfigFnObject, type UserConfigFnPromise, type ViteDevServer, type WatchOptions, WebSocket, WebSocketAlias, type WebSocketClient, type WebSocketCustomListener, WebSocketServer, build, buildErrorMessage, createFilter, createLogger, createServer, createViteRuntime, defineConfig, fetchModule, formatPostcssSourceMap, isCSSRequest, isFileServingAllowed, loadConfigFromFile, loadEnv, mergeAlias, mergeConfig, normalizePath, optimizeDeps, preprocessCSS, preview, resolveConfig, resolveEnvPrefix, rollupVersion, searchForWorkspaceRoot, send, sortUserPlugins, splitVendorChunk, splitVendorChunkPlugin, transformWithEsbuild, VERSION as version };
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
export { parseAst, parseAstAsync } from 'rollup/parseAst';
|
||||||
import { i as isInNodeModules, a as arraify } from './chunks/dep-BK3b2jBa.js';
|
import { i as isInNodeModules, a as arraify } from './chunks/dep-p3C6MpSJ.js';
|
||||||
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, y as isFileLoadingAllowed, x as isFileServingAllowed, l as loadConfigFromFile, z as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, A as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-BK3b2jBa.js';
|
export { b as build, g as buildErrorMessage, k as createFilter, v as createLogger, c as createServer, d as defineConfig, h as fetchModule, f as formatPostcssSourceMap, x as isFileServingAllowed, l as loadConfigFromFile, y as loadEnv, j as mergeAlias, m as mergeConfig, n as normalizePath, o as optimizeDeps, e as preprocessCSS, p as preview, r as resolveConfig, z as resolveEnvPrefix, q as rollupVersion, w as searchForWorkspaceRoot, u as send, s as sortUserPlugins, t as transformWithEsbuild } from './chunks/dep-p3C6MpSJ.js';
|
||||||
export { VERSION as version } from './constants.js';
|
export { VERSION as version } from './constants.js';
|
||||||
export { version as esbuildVersion } from 'esbuild';
|
export { version as esbuildVersion } from 'esbuild';
|
||||||
import { existsSync, readFileSync } from 'node:fs';
|
import { existsSync, readFileSync } from 'node:fs';
|
||||||
|
|
@ -11,25 +11,23 @@ import 'node:url';
|
||||||
import 'node:util';
|
import 'node:util';
|
||||||
import 'node:perf_hooks';
|
import 'node:perf_hooks';
|
||||||
import 'node:module';
|
import 'node:module';
|
||||||
import 'node:crypto';
|
|
||||||
import 'tty';
|
import 'tty';
|
||||||
import 'path';
|
import 'path';
|
||||||
import 'fs';
|
import 'fs';
|
||||||
import 'node:events';
|
import 'events';
|
||||||
import 'node:stream';
|
import 'assert';
|
||||||
import 'node:string_decoder';
|
|
||||||
import 'node:child_process';
|
import 'node:child_process';
|
||||||
import 'node:http';
|
import 'node:http';
|
||||||
import 'node:https';
|
import 'node:https';
|
||||||
import 'util';
|
import 'util';
|
||||||
import 'net';
|
import 'net';
|
||||||
import 'events';
|
|
||||||
import 'url';
|
import 'url';
|
||||||
import 'http';
|
import 'http';
|
||||||
import 'stream';
|
import 'stream';
|
||||||
import 'os';
|
import 'os';
|
||||||
import 'child_process';
|
import 'child_process';
|
||||||
import 'node:os';
|
import 'node:os';
|
||||||
|
import 'node:crypto';
|
||||||
import 'node:dns';
|
import 'node:dns';
|
||||||
import 'crypto';
|
import 'crypto';
|
||||||
import 'module';
|
import 'module';
|
||||||
|
|
@ -37,225 +35,238 @@ import 'node:assert';
|
||||||
import 'node:v8';
|
import 'node:v8';
|
||||||
import 'node:worker_threads';
|
import 'node:worker_threads';
|
||||||
import 'node:buffer';
|
import 'node:buffer';
|
||||||
|
import 'node:events';
|
||||||
import 'querystring';
|
import 'querystring';
|
||||||
import 'node:readline';
|
import 'node:readline';
|
||||||
import 'zlib';
|
import 'zlib';
|
||||||
import 'buffer';
|
import 'buffer';
|
||||||
import 'https';
|
import 'https';
|
||||||
import 'tls';
|
import 'tls';
|
||||||
import 'node:net';
|
|
||||||
import 'assert';
|
|
||||||
import 'node:zlib';
|
import 'node:zlib';
|
||||||
|
|
||||||
const CSS_LANGS_RE = (
|
// This file will be built for both ESM and CJS. Avoid relying on other modules as possible.
|
||||||
// eslint-disable-next-line regexp/no-unused-capturing-group
|
// copy from constants.ts
|
||||||
/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/
|
const CSS_LANGS_RE =
|
||||||
);
|
// eslint-disable-next-line regexp/no-unused-capturing-group
|
||||||
|
/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/;
|
||||||
const isCSSRequest = (request) => CSS_LANGS_RE.test(request);
|
const isCSSRequest = (request) => CSS_LANGS_RE.test(request);
|
||||||
|
// Use splitVendorChunkPlugin() to get the same manualChunks strategy as Vite 2.7
|
||||||
|
// We don't recommend using this strategy as a general solution moving forward
|
||||||
|
// splitVendorChunk is a simple index/vendor strategy that was used in Vite
|
||||||
|
// until v2.8. It is exposed to let people continue to use it in case it was
|
||||||
|
// working well for their setups.
|
||||||
|
// The cache needs to be reset on buildStart for watch mode to work correctly
|
||||||
|
// Don't use this manualChunks strategy for ssr, lib mode, and 'umd' or 'iife'
|
||||||
|
/**
|
||||||
|
* @deprecated use build.rollupOptions.output.manualChunks or framework specific configuration
|
||||||
|
*/
|
||||||
class SplitVendorChunkCache {
|
class SplitVendorChunkCache {
|
||||||
cache;
|
cache;
|
||||||
constructor() {
|
constructor() {
|
||||||
this.cache = /* @__PURE__ */ new Map();
|
this.cache = new Map();
|
||||||
}
|
|
||||||
reset() {
|
|
||||||
this.cache = /* @__PURE__ */ new Map();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function splitVendorChunk(options = {}) {
|
|
||||||
const cache = options.cache ?? new SplitVendorChunkCache();
|
|
||||||
return (id, { getModuleInfo }) => {
|
|
||||||
if (isInNodeModules(id) && !isCSSRequest(id) && staticImportedByEntry(id, getModuleInfo, cache.cache)) {
|
|
||||||
return "vendor";
|
|
||||||
}
|
}
|
||||||
};
|
reset() {
|
||||||
|
this.cache = new Map();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @deprecated use build.rollupOptions.output.manualChunks or framework specific configuration
|
||||||
|
*/
|
||||||
|
function splitVendorChunk(options = {}) {
|
||||||
|
const cache = options.cache ?? new SplitVendorChunkCache();
|
||||||
|
return (id, { getModuleInfo }) => {
|
||||||
|
if (isInNodeModules(id) &&
|
||||||
|
!isCSSRequest(id) &&
|
||||||
|
staticImportedByEntry(id, getModuleInfo, cache.cache)) {
|
||||||
|
return 'vendor';
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) {
|
function staticImportedByEntry(id, getModuleInfo, cache, importStack = []) {
|
||||||
if (cache.has(id)) {
|
if (cache.has(id)) {
|
||||||
return cache.get(id);
|
return cache.get(id);
|
||||||
}
|
}
|
||||||
if (importStack.includes(id)) {
|
if (importStack.includes(id)) {
|
||||||
cache.set(id, false);
|
// circular deps!
|
||||||
return false;
|
cache.set(id, false);
|
||||||
}
|
return false;
|
||||||
const mod = getModuleInfo(id);
|
}
|
||||||
if (!mod) {
|
const mod = getModuleInfo(id);
|
||||||
cache.set(id, false);
|
if (!mod) {
|
||||||
return false;
|
cache.set(id, false);
|
||||||
}
|
return false;
|
||||||
if (mod.isEntry) {
|
}
|
||||||
cache.set(id, true);
|
if (mod.isEntry) {
|
||||||
return true;
|
cache.set(id, true);
|
||||||
}
|
return true;
|
||||||
const someImporterIs = mod.importers.some(
|
}
|
||||||
(importer) => staticImportedByEntry(
|
const someImporterIs = mod.importers.some((importer) => staticImportedByEntry(importer, getModuleInfo, cache, importStack.concat(id)));
|
||||||
importer,
|
cache.set(id, someImporterIs);
|
||||||
getModuleInfo,
|
return someImporterIs;
|
||||||
cache,
|
|
||||||
importStack.concat(id)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
cache.set(id, someImporterIs);
|
|
||||||
return someImporterIs;
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @deprecated use build.rollupOptions.output.manualChunks or framework specific configuration
|
||||||
|
*/
|
||||||
function splitVendorChunkPlugin() {
|
function splitVendorChunkPlugin() {
|
||||||
const caches = [];
|
const caches = [];
|
||||||
function createSplitVendorChunk(output, config) {
|
function createSplitVendorChunk(output, config) {
|
||||||
const cache = new SplitVendorChunkCache();
|
const cache = new SplitVendorChunkCache();
|
||||||
caches.push(cache);
|
caches.push(cache);
|
||||||
const build = config.build ?? {};
|
const build = config.build ?? {};
|
||||||
const format = output?.format;
|
const format = output?.format;
|
||||||
if (!build.ssr && !build.lib && format !== "umd" && format !== "iife") {
|
if (!build.ssr && !build.lib && format !== 'umd' && format !== 'iife') {
|
||||||
return splitVendorChunk({ cache });
|
return splitVendorChunk({ cache });
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
name: "vite:split-vendor-chunk",
|
|
||||||
config(config) {
|
|
||||||
let outputs = config?.build?.rollupOptions?.output;
|
|
||||||
if (outputs) {
|
|
||||||
outputs = arraify(outputs);
|
|
||||||
for (const output of outputs) {
|
|
||||||
const viteManualChunks = createSplitVendorChunk(output, config);
|
|
||||||
if (viteManualChunks) {
|
|
||||||
if (output.manualChunks) {
|
|
||||||
if (typeof output.manualChunks === "function") {
|
|
||||||
const userManualChunks = output.manualChunks;
|
|
||||||
output.manualChunks = (id, api) => {
|
|
||||||
return userManualChunks(id, api) ?? viteManualChunks(id, api);
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
console.warn(
|
|
||||||
"(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead."
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
output.manualChunks = viteManualChunks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
build: {
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks: createSplitVendorChunk({}, config)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buildStart() {
|
|
||||||
caches.forEach((cache) => cache.reset());
|
|
||||||
}
|
}
|
||||||
};
|
return {
|
||||||
|
name: 'vite:split-vendor-chunk',
|
||||||
|
config(config) {
|
||||||
|
let outputs = config?.build?.rollupOptions?.output;
|
||||||
|
if (outputs) {
|
||||||
|
outputs = arraify(outputs);
|
||||||
|
for (const output of outputs) {
|
||||||
|
const viteManualChunks = createSplitVendorChunk(output, config);
|
||||||
|
if (viteManualChunks) {
|
||||||
|
if (output.manualChunks) {
|
||||||
|
if (typeof output.manualChunks === 'function') {
|
||||||
|
const userManualChunks = output.manualChunks;
|
||||||
|
output.manualChunks = (id, api) => {
|
||||||
|
return userManualChunks(id, api) ?? viteManualChunks(id, api);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// else, leave the object form of manualChunks untouched, as
|
||||||
|
// we can't safely replicate rollup handling.
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
|
console.warn("(!) the `splitVendorChunk` plugin doesn't have any effect when using the object form of `build.rollupOptions.output.manualChunks`. Consider using the function form instead.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
output.manualChunks = viteManualChunks;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return {
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: createSplitVendorChunk({}, config),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buildStart() {
|
||||||
|
caches.forEach((cache) => cache.reset());
|
||||||
|
},
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
class ServerHMRBroadcasterClient {
|
class ServerHMRBroadcasterClient {
|
||||||
constructor(hmrChannel) {
|
hmrChannel;
|
||||||
this.hmrChannel = hmrChannel;
|
constructor(hmrChannel) {
|
||||||
}
|
this.hmrChannel = hmrChannel;
|
||||||
send(...args) {
|
|
||||||
let payload;
|
|
||||||
if (typeof args[0] === "string") {
|
|
||||||
payload = {
|
|
||||||
type: "custom",
|
|
||||||
event: args[0],
|
|
||||||
data: args[1]
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
payload = args[0];
|
|
||||||
}
|
}
|
||||||
if (payload.type !== "custom") {
|
send(...args) {
|
||||||
throw new Error(
|
let payload;
|
||||||
"Cannot send non-custom events from the client to the server."
|
if (typeof args[0] === 'string') {
|
||||||
);
|
payload = {
|
||||||
|
type: 'custom',
|
||||||
|
event: args[0],
|
||||||
|
data: args[1],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
payload = args[0];
|
||||||
|
}
|
||||||
|
if (payload.type !== 'custom') {
|
||||||
|
throw new Error('Cannot send non-custom events from the client to the server.');
|
||||||
|
}
|
||||||
|
this.hmrChannel.send(payload);
|
||||||
}
|
}
|
||||||
this.hmrChannel.send(payload);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* The connector class to establish HMR communication between the server and the Vite runtime.
|
||||||
|
* @experimental
|
||||||
|
*/
|
||||||
class ServerHMRConnector {
|
class ServerHMRConnector {
|
||||||
handlers = [];
|
handlers = [];
|
||||||
hmrChannel;
|
hmrChannel;
|
||||||
hmrClient;
|
hmrClient;
|
||||||
connected = false;
|
connected = false;
|
||||||
constructor(server) {
|
constructor(server) {
|
||||||
const hmrChannel = server.hot?.channels.find(
|
const hmrChannel = server.hot?.channels.find((c) => c.name === 'ssr');
|
||||||
(c) => c.name === "ssr"
|
if (!hmrChannel) {
|
||||||
);
|
throw new Error("Your version of Vite doesn't support HMR during SSR. Please, use Vite 5.1 or higher.");
|
||||||
if (!hmrChannel) {
|
}
|
||||||
throw new Error(
|
this.hmrClient = new ServerHMRBroadcasterClient(hmrChannel);
|
||||||
"Your version of Vite doesn't support HMR during SSR. Please, use Vite 5.1 or higher."
|
hmrChannel.api.outsideEmitter.on('send', (payload) => {
|
||||||
);
|
this.handlers.forEach((listener) => listener(payload));
|
||||||
|
});
|
||||||
|
this.hmrChannel = hmrChannel;
|
||||||
|
}
|
||||||
|
isReady() {
|
||||||
|
return this.connected;
|
||||||
|
}
|
||||||
|
send(message) {
|
||||||
|
const payload = JSON.parse(message);
|
||||||
|
this.hmrChannel.api.innerEmitter.emit(payload.event, payload.data, this.hmrClient);
|
||||||
|
}
|
||||||
|
onUpdate(handler) {
|
||||||
|
this.handlers.push(handler);
|
||||||
|
handler({ type: 'connected' });
|
||||||
|
this.connected = true;
|
||||||
}
|
}
|
||||||
this.hmrClient = new ServerHMRBroadcasterClient(hmrChannel);
|
|
||||||
hmrChannel.api.outsideEmitter.on("send", (payload) => {
|
|
||||||
this.handlers.forEach((listener) => listener(payload));
|
|
||||||
});
|
|
||||||
this.hmrChannel = hmrChannel;
|
|
||||||
}
|
|
||||||
isReady() {
|
|
||||||
return this.connected;
|
|
||||||
}
|
|
||||||
send(message) {
|
|
||||||
const payload = JSON.parse(message);
|
|
||||||
this.hmrChannel.api.innerEmitter.emit(
|
|
||||||
payload.event,
|
|
||||||
payload.data,
|
|
||||||
this.hmrClient
|
|
||||||
);
|
|
||||||
}
|
|
||||||
onUpdate(handler) {
|
|
||||||
this.handlers.push(handler);
|
|
||||||
handler({ type: "connected" });
|
|
||||||
this.connected = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createHMROptions(server, options) {
|
function createHMROptions(server, options) {
|
||||||
if (server.config.server.hmr === false || options.hmr === false) {
|
if (server.config.server.hmr === false || options.hmr === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const connection = new ServerHMRConnector(server);
|
const connection = new ServerHMRConnector(server);
|
||||||
return {
|
return {
|
||||||
connection,
|
connection,
|
||||||
logger: options.hmr?.logger
|
logger: options.hmr?.logger,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const prepareStackTrace = {
|
const prepareStackTrace = {
|
||||||
retrieveFile(id) {
|
retrieveFile(id) {
|
||||||
if (existsSync(id)) {
|
if (existsSync(id)) {
|
||||||
return readFileSync(id, "utf-8");
|
return readFileSync(id, 'utf-8');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
function resolveSourceMapOptions(options) {
|
function resolveSourceMapOptions(options) {
|
||||||
if (options.sourcemapInterceptor != null) {
|
if (options.sourcemapInterceptor != null) {
|
||||||
if (options.sourcemapInterceptor === "prepareStackTrace") {
|
if (options.sourcemapInterceptor === 'prepareStackTrace') {
|
||||||
return prepareStackTrace;
|
return prepareStackTrace;
|
||||||
|
}
|
||||||
|
if (typeof options.sourcemapInterceptor === 'object') {
|
||||||
|
return { ...prepareStackTrace, ...options.sourcemapInterceptor };
|
||||||
|
}
|
||||||
|
return options.sourcemapInterceptor;
|
||||||
}
|
}
|
||||||
if (typeof options.sourcemapInterceptor === "object") {
|
if (typeof process !== 'undefined' && 'setSourceMapsEnabled' in process) {
|
||||||
return { ...prepareStackTrace, ...options.sourcemapInterceptor };
|
return 'node';
|
||||||
}
|
}
|
||||||
return options.sourcemapInterceptor;
|
return prepareStackTrace;
|
||||||
}
|
|
||||||
if (typeof process !== "undefined" && "setSourceMapsEnabled" in process) {
|
|
||||||
return "node";
|
|
||||||
}
|
|
||||||
return prepareStackTrace;
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Create an instance of the Vite SSR runtime that support HMR.
|
||||||
|
* @experimental
|
||||||
|
*/
|
||||||
async function createViteRuntime(server, options = {}) {
|
async function createViteRuntime(server, options = {}) {
|
||||||
const hmr = createHMROptions(server, options);
|
const hmr = createHMROptions(server, options);
|
||||||
return new ViteRuntime(
|
return new ViteRuntime({
|
||||||
{
|
...options,
|
||||||
...options,
|
root: server.config.root,
|
||||||
root: server.config.root,
|
fetchModule: server.ssrFetchModule,
|
||||||
fetchModule: server.ssrFetchModule,
|
hmr,
|
||||||
hmr,
|
sourcemapInterceptor: resolveSourceMapOptions(options),
|
||||||
sourcemapInterceptor: resolveSourceMapOptions(options)
|
}, options.runner || new ESModulesRunner());
|
||||||
},
|
|
||||||
options.runner || new ESModulesRunner()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export { ServerHMRConnector, createViteRuntime, isCSSRequest, splitVendorChunk, splitVendorChunkPlugin };
|
export { ServerHMRConnector, createViteRuntime, isCSSRequest, splitVendorChunk, splitVendorChunkPlugin };
|
||||||
|
|
|
||||||
|
|
@ -51,22 +51,24 @@ function normalizeString(path, allowAboveRoot) {
|
||||||
char = "/";
|
char = "/";
|
||||||
}
|
}
|
||||||
if (char === "/") {
|
if (char === "/") {
|
||||||
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
if (!(lastSlash === index - 1 || dots === 1))
|
||||||
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
if (dots === 2) {
|
||||||
if (res.length > 2) {
|
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
||||||
const lastSlashIndex = res.lastIndexOf("/");
|
if (res.length > 2) {
|
||||||
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
const lastSlashIndex = res.lastIndexOf("/");
|
||||||
continue;
|
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
||||||
} else if (res.length > 0) {
|
continue;
|
||||||
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
} else if (res.length > 0) {
|
||||||
continue;
|
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
||||||
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
} else
|
||||||
} else
|
res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
||||||
res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
||||||
lastSlash = index, dots = 0;
|
lastSlash = index, dots = 0;
|
||||||
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
} else
|
||||||
|
char === "." && dots !== -1 ? ++dots : dots = -1;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
@ -94,46 +96,38 @@ for (let i = 0; i < chars.length; i++) {
|
||||||
const c = chars.charCodeAt(i);
|
const c = chars.charCodeAt(i);
|
||||||
intToChar[i] = c, charToInt[c] = i;
|
intToChar[i] = c, charToInt[c] = i;
|
||||||
}
|
}
|
||||||
function decodeInteger(reader, relative) {
|
function decode(mappings) {
|
||||||
|
const state = new Int32Array(5), decoded = [];
|
||||||
|
let index = 0;
|
||||||
|
do {
|
||||||
|
const semi = indexOf(mappings, index), line = [];
|
||||||
|
let sorted = !0, lastCol = 0;
|
||||||
|
state[0] = 0;
|
||||||
|
for (let i = index; i < semi; i++) {
|
||||||
|
let seg;
|
||||||
|
i = decodeInteger(mappings, i, state, 0);
|
||||||
|
const col = state[0];
|
||||||
|
col < lastCol && (sorted = !1), lastCol = col, hasMoreVlq(mappings, i, semi) ? (i = decodeInteger(mappings, i, state, 1), i = decodeInteger(mappings, i, state, 2), i = decodeInteger(mappings, i, state, 3), hasMoreVlq(mappings, i, semi) ? (i = decodeInteger(mappings, i, state, 4), seg = [col, state[1], state[2], state[3], state[4]]) : seg = [col, state[1], state[2], state[3]]) : seg = [col], line.push(seg);
|
||||||
|
}
|
||||||
|
sorted || sort(line), decoded.push(line), index = semi + 1;
|
||||||
|
} while (index <= mappings.length);
|
||||||
|
return decoded;
|
||||||
|
}
|
||||||
|
function indexOf(mappings, index) {
|
||||||
|
const idx = mappings.indexOf(";", index);
|
||||||
|
return idx === -1 ? mappings.length : idx;
|
||||||
|
}
|
||||||
|
function decodeInteger(mappings, pos, state, j) {
|
||||||
let value = 0, shift = 0, integer = 0;
|
let value = 0, shift = 0, integer = 0;
|
||||||
do {
|
do {
|
||||||
const c = reader.next();
|
const c = mappings.charCodeAt(pos++);
|
||||||
integer = charToInt[c], value |= (integer & 31) << shift, shift += 5;
|
integer = charToInt[c], value |= (integer & 31) << shift, shift += 5;
|
||||||
} while (integer & 32);
|
} while (integer & 32);
|
||||||
const shouldNegate = value & 1;
|
const shouldNegate = value & 1;
|
||||||
return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
|
return value >>>= 1, shouldNegate && (value = -2147483648 | -value), state[j] += value, pos;
|
||||||
}
|
}
|
||||||
function hasMoreVlq(reader, max) {
|
function hasMoreVlq(mappings, i, length) {
|
||||||
return reader.pos >= max ? !1 : reader.peek() !== comma;
|
return i >= length ? !1 : mappings.charCodeAt(i) !== comma;
|
||||||
}
|
|
||||||
class StringReader {
|
|
||||||
constructor(buffer) {
|
|
||||||
this.pos = 0, this.buffer = buffer;
|
|
||||||
}
|
|
||||||
next() {
|
|
||||||
return this.buffer.charCodeAt(this.pos++);
|
|
||||||
}
|
|
||||||
peek() {
|
|
||||||
return this.buffer.charCodeAt(this.pos);
|
|
||||||
}
|
|
||||||
indexOf(char) {
|
|
||||||
const { buffer, pos } = this, idx = buffer.indexOf(char, pos);
|
|
||||||
return idx === -1 ? buffer.length : idx;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function decode(mappings) {
|
|
||||||
const { length } = mappings, reader = new StringReader(mappings), decoded = [];
|
|
||||||
let genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
|
|
||||||
do {
|
|
||||||
const semi = reader.indexOf(";"), line = [];
|
|
||||||
let sorted = !0, lastCol = 0;
|
|
||||||
for (genColumn = 0; reader.pos < semi; ) {
|
|
||||||
let seg;
|
|
||||||
genColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]) : seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]) : seg = [genColumn], line.push(seg), reader.pos++;
|
|
||||||
}
|
|
||||||
sorted || sort(line), decoded.push(line), reader.pos = semi + 1;
|
|
||||||
} while (reader.pos <= length);
|
|
||||||
return decoded;
|
|
||||||
}
|
}
|
||||||
function sort(line) {
|
function sort(line) {
|
||||||
line.sort(sortComparator);
|
line.sort(sortComparator);
|
||||||
|
|
@ -206,13 +200,7 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
||||||
return found ? index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index) : bias === LEAST_UPPER_BOUND && index++, index === -1 || index === segments.length ? -1 : index;
|
return found ? index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index) : bias === LEAST_UPPER_BOUND && index++, index === -1 || index === segments.length ? -1 : index;
|
||||||
}
|
}
|
||||||
class DecodedMap {
|
class DecodedMap {
|
||||||
constructor(map, from) {
|
map;
|
||||||
this.map = map;
|
|
||||||
const { mappings, names, sources } = map;
|
|
||||||
this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.resolvedSources = (sources || []).map(
|
|
||||||
(s) => posixResolve(s || "", from)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
_encoded;
|
_encoded;
|
||||||
_decoded;
|
_decoded;
|
||||||
_decodedMemo;
|
_decodedMemo;
|
||||||
|
|
@ -220,6 +208,11 @@ class DecodedMap {
|
||||||
version;
|
version;
|
||||||
names = [];
|
names = [];
|
||||||
resolvedSources;
|
resolvedSources;
|
||||||
|
constructor(map, from) {
|
||||||
|
this.map = map;
|
||||||
|
const { mappings, names, sources } = map;
|
||||||
|
this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.resolvedSources = (sources || []).map((s) => posixResolve(s || "", from));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function memoizedState() {
|
function memoizedState() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -232,9 +225,7 @@ function getOriginalPosition(map, needle) {
|
||||||
const result = originalPositionFor(map, needle);
|
const result = originalPositionFor(map, needle);
|
||||||
return result.column == null ? null : result;
|
return result.column == null ? null : result;
|
||||||
}
|
}
|
||||||
const VITE_RUNTIME_SOURCEMAPPING_REGEXP = new RegExp(
|
const VITE_RUNTIME_SOURCEMAPPING_REGEXP = new RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
||||||
`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`
|
|
||||||
);
|
|
||||||
class ModuleCacheMap extends Map {
|
class ModuleCacheMap extends Map {
|
||||||
root;
|
root;
|
||||||
constructor(root, entries) {
|
constructor(root, entries) {
|
||||||
|
|
@ -276,16 +267,17 @@ class ModuleCacheMap extends Map {
|
||||||
const module = this.get(id);
|
const module = this.get(id);
|
||||||
module.evaluated = !1, module.meta = void 0, module.map = void 0, module.promise = void 0, module.exports = void 0, module.imports?.clear();
|
module.evaluated = !1, module.meta = void 0, module.map = void 0, module.promise = void 0, module.exports = void 0, module.imports?.clear();
|
||||||
}
|
}
|
||||||
isImported({
|
isImported({ importedId, importedBy }, seen = /* @__PURE__ */ new Set()) {
|
||||||
importedId,
|
if (importedId = this.normalize(importedId), importedBy = this.normalize(importedBy), importedBy === importedId)
|
||||||
importedBy
|
return !0;
|
||||||
}, seen = /* @__PURE__ */ new Set()) {
|
if (seen.has(importedId))
|
||||||
if (importedId = this.normalize(importedId), importedBy = this.normalize(importedBy), importedBy === importedId) return !0;
|
return !1;
|
||||||
if (seen.has(importedId)) return !1;
|
|
||||||
seen.add(importedId);
|
seen.add(importedId);
|
||||||
const importers = this.getByModuleId(importedId)?.importers;
|
const importers = this.getByModuleId(importedId)?.importers;
|
||||||
if (!importers) return !1;
|
if (!importers)
|
||||||
if (importers.has(importedBy)) return !0;
|
return !1;
|
||||||
|
if (importers.has(importedBy))
|
||||||
|
return !0;
|
||||||
for (const importer of importers)
|
for (const importer of importers)
|
||||||
if (this.isImported({
|
if (this.isImported({
|
||||||
importedBy,
|
importedBy,
|
||||||
|
|
@ -300,7 +292,8 @@ class ModuleCacheMap extends Map {
|
||||||
invalidateDepTree(ids, invalidated = /* @__PURE__ */ new Set()) {
|
invalidateDepTree(ids, invalidated = /* @__PURE__ */ new Set()) {
|
||||||
for (const _id of ids) {
|
for (const _id of ids) {
|
||||||
const id = this.normalize(_id);
|
const id = this.normalize(_id);
|
||||||
if (invalidated.has(id)) continue;
|
if (invalidated.has(id))
|
||||||
|
continue;
|
||||||
invalidated.add(id);
|
invalidated.add(id);
|
||||||
const mod = super.get(id);
|
const mod = super.get(id);
|
||||||
mod?.importers && this.invalidateDepTree(mod.importers, invalidated), super.delete(id);
|
mod?.importers && this.invalidateDepTree(mod.importers, invalidated), super.delete(id);
|
||||||
|
|
@ -313,7 +306,8 @@ class ModuleCacheMap extends Map {
|
||||||
invalidateSubDepTree(ids, invalidated = /* @__PURE__ */ new Set()) {
|
invalidateSubDepTree(ids, invalidated = /* @__PURE__ */ new Set()) {
|
||||||
for (const _id of ids) {
|
for (const _id of ids) {
|
||||||
const id = this.normalize(_id);
|
const id = this.normalize(_id);
|
||||||
if (invalidated.has(id)) continue;
|
if (invalidated.has(id))
|
||||||
|
continue;
|
||||||
invalidated.add(id);
|
invalidated.add(id);
|
||||||
const subIds = Array.from(super.entries()).filter(([, mod]) => mod.importers?.has(id)).map(([key]) => key);
|
const subIds = Array.from(super.entries()).filter(([, mod]) => mod.importers?.has(id)).map(([key]) => key);
|
||||||
subIds.length && this.invalidateSubDepTree(subIds, invalidated), super.delete(id);
|
subIds.length && this.invalidateSubDepTree(subIds, invalidated), super.delete(id);
|
||||||
|
|
@ -322,21 +316,28 @@ class ModuleCacheMap extends Map {
|
||||||
}
|
}
|
||||||
getSourceMap(moduleId) {
|
getSourceMap(moduleId) {
|
||||||
const mod = this.get(moduleId);
|
const mod = this.get(moduleId);
|
||||||
if (mod.map) return mod.map;
|
if (mod.map)
|
||||||
if (!mod.meta || !("code" in mod.meta)) return null;
|
return mod.map;
|
||||||
const mapString = VITE_RUNTIME_SOURCEMAPPING_REGEXP.exec(mod.meta.code)?.[1];
|
if (!mod.meta || !("code" in mod.meta))
|
||||||
if (!mapString) return null;
|
return null;
|
||||||
|
const mapString = mod.meta.code.match(VITE_RUNTIME_SOURCEMAPPING_REGEXP)?.[1];
|
||||||
|
if (!mapString)
|
||||||
|
return null;
|
||||||
const baseFile = mod.meta.file || moduleId.split("?")[0];
|
const baseFile = mod.meta.file || moduleId.split("?")[0];
|
||||||
return mod.map = new DecodedMap(JSON.parse(decodeBase64(mapString)), baseFile), mod.map;
|
return mod.map = new DecodedMap(JSON.parse(decodeBase64(mapString)), baseFile), mod.map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const prefixedBuiltins = /* @__PURE__ */ new Set(["node:test"]);
|
const prefixedBuiltins = /* @__PURE__ */ new Set(["node:test"]);
|
||||||
function normalizeModuleId(file, root) {
|
function normalizeModuleId(file, root) {
|
||||||
if (prefixedBuiltins.has(file)) return file;
|
if (prefixedBuiltins.has(file))
|
||||||
|
return file;
|
||||||
let unixFile = slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/");
|
let unixFile = slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/");
|
||||||
return unixFile.startsWith(root) && (unixFile = unixFile.slice(root.length - 1)), unixFile.replace(/^file:\//, "/");
|
return unixFile.startsWith(root) && (unixFile = unixFile.slice(root.length - 1)), unixFile.replace(/^file:\//, "/");
|
||||||
}
|
}
|
||||||
class HMRContext {
|
class HMRContext {
|
||||||
|
hmrClient;
|
||||||
|
ownerPath;
|
||||||
|
newListeners;
|
||||||
constructor(hmrClient, ownerPath) {
|
constructor(hmrClient, ownerPath) {
|
||||||
this.hmrClient = hmrClient, this.ownerPath = ownerPath, hmrClient.dataMap.has(ownerPath) || hmrClient.dataMap.set(ownerPath, {});
|
this.hmrClient = hmrClient, this.ownerPath = ownerPath, hmrClient.dataMap.has(ownerPath) || hmrClient.dataMap.set(ownerPath, {});
|
||||||
const mod = hmrClient.hotModulesMap.get(ownerPath);
|
const mod = hmrClient.hotModulesMap.get(ownerPath);
|
||||||
|
|
@ -345,14 +346,10 @@ class HMRContext {
|
||||||
if (staleListeners)
|
if (staleListeners)
|
||||||
for (const [event, staleFns] of staleListeners) {
|
for (const [event, staleFns] of staleListeners) {
|
||||||
const listeners = hmrClient.customListenersMap.get(event);
|
const listeners = hmrClient.customListenersMap.get(event);
|
||||||
listeners && hmrClient.customListenersMap.set(
|
listeners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
|
||||||
event,
|
|
||||||
listeners.filter((l) => !staleFns.includes(l))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
this.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
this.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
|
||||||
}
|
}
|
||||||
newListeners;
|
|
||||||
get data() {
|
get data() {
|
||||||
return this.hmrClient.dataMap.get(this.ownerPath);
|
return this.hmrClient.dataMap.get(this.ownerPath);
|
||||||
}
|
}
|
||||||
|
|
@ -385,9 +382,7 @@ class HMRContext {
|
||||||
this.hmrClient.notifyListeners("vite:invalidate", {
|
this.hmrClient.notifyListeners("vite:invalidate", {
|
||||||
path: this.ownerPath,
|
path: this.ownerPath,
|
||||||
message
|
message
|
||||||
}), this.send("vite:invalidate", { path: this.ownerPath, message }), this.hmrClient.logger.debug(
|
}), this.send("vite:invalidate", { path: this.ownerPath, message }), this.hmrClient.logger.debug(`[vite] invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`);
|
||||||
`[vite] invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
on(event, cb) {
|
on(event, cb) {
|
||||||
const addToMap = (map) => {
|
const addToMap = (map) => {
|
||||||
|
|
@ -411,9 +406,7 @@ class HMRContext {
|
||||||
removeFromMap(this.hmrClient.customListenersMap), removeFromMap(this.newListeners);
|
removeFromMap(this.hmrClient.customListenersMap), removeFromMap(this.newListeners);
|
||||||
}
|
}
|
||||||
send(event, data) {
|
send(event, data) {
|
||||||
this.hmrClient.messenger.send(
|
this.hmrClient.messenger.send(JSON.stringify({ type: "custom", event, data }));
|
||||||
JSON.stringify({ type: "custom", event, data })
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
acceptDeps(deps, callback = () => {
|
acceptDeps(deps, callback = () => {
|
||||||
}) {
|
}) {
|
||||||
|
|
@ -428,6 +421,7 @@ class HMRContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class HMRMessenger {
|
class HMRMessenger {
|
||||||
|
connection;
|
||||||
constructor(connection) {
|
constructor(connection) {
|
||||||
this.connection = connection;
|
this.connection = connection;
|
||||||
}
|
}
|
||||||
|
|
@ -440,9 +434,8 @@ class HMRMessenger {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
class HMRClient {
|
class HMRClient {
|
||||||
constructor(logger, connection, importUpdatedModule) {
|
logger;
|
||||||
this.logger = logger, this.importUpdatedModule = importUpdatedModule, this.messenger = new HMRMessenger(connection);
|
importUpdatedModule;
|
||||||
}
|
|
||||||
hotModulesMap = /* @__PURE__ */ new Map();
|
hotModulesMap = /* @__PURE__ */ new Map();
|
||||||
disposeMap = /* @__PURE__ */ new Map();
|
disposeMap = /* @__PURE__ */ new Map();
|
||||||
pruneMap = /* @__PURE__ */ new Map();
|
pruneMap = /* @__PURE__ */ new Map();
|
||||||
|
|
@ -450,6 +443,9 @@ class HMRClient {
|
||||||
customListenersMap = /* @__PURE__ */ new Map();
|
customListenersMap = /* @__PURE__ */ new Map();
|
||||||
ctxToListenersMap = /* @__PURE__ */ new Map();
|
ctxToListenersMap = /* @__PURE__ */ new Map();
|
||||||
messenger;
|
messenger;
|
||||||
|
constructor(logger, connection, importUpdatedModule) {
|
||||||
|
this.logger = logger, this.importUpdatedModule = importUpdatedModule, this.messenger = new HMRMessenger(connection);
|
||||||
|
}
|
||||||
async notifyListeners(event, data) {
|
async notifyListeners(event, data) {
|
||||||
const cbs = this.customListenersMap.get(event);
|
const cbs = this.customListenersMap.get(event);
|
||||||
cbs && await Promise.allSettled(cbs.map((cb) => cb(data)));
|
cbs && await Promise.allSettled(cbs.map((cb) => cb(data)));
|
||||||
|
|
@ -461,20 +457,17 @@ class HMRClient {
|
||||||
// but they may have left behind side effects that need to be cleaned up
|
// but they may have left behind side effects that need to be cleaned up
|
||||||
// (.e.g style injections)
|
// (.e.g style injections)
|
||||||
async prunePaths(paths) {
|
async prunePaths(paths) {
|
||||||
await Promise.all(
|
await Promise.all(paths.map((path) => {
|
||||||
paths.map((path) => {
|
const disposer = this.disposeMap.get(path);
|
||||||
const disposer = this.disposeMap.get(path);
|
if (disposer)
|
||||||
if (disposer) return disposer(this.dataMap.get(path));
|
return disposer(this.dataMap.get(path));
|
||||||
})
|
})), paths.forEach((path) => {
|
||||||
), paths.forEach((path) => {
|
|
||||||
const fn = this.pruneMap.get(path);
|
const fn = this.pruneMap.get(path);
|
||||||
fn && fn(this.dataMap.get(path));
|
fn && fn(this.dataMap.get(path));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
warnFailedUpdate(err, path) {
|
warnFailedUpdate(err, path) {
|
||||||
err.message.includes("fetch") || this.logger.error(err), this.logger.error(
|
err.message.includes("fetch") || this.logger.error(err), this.logger.error(`[hmr] Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
|
||||||
`[hmr] Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
updateQueue = [];
|
updateQueue = [];
|
||||||
pendingUpdateQueue = !1;
|
pendingUpdateQueue = !1;
|
||||||
|
|
@ -495,9 +488,7 @@ class HMRClient {
|
||||||
if (!mod)
|
if (!mod)
|
||||||
return;
|
return;
|
||||||
let fetchedModule;
|
let fetchedModule;
|
||||||
const isSelfUpdate = path === acceptedPath, qualifiedCallbacks = mod.callbacks.filter(
|
const isSelfUpdate = path === acceptedPath, qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));
|
||||||
({ deps }) => deps.includes(acceptedPath)
|
|
||||||
);
|
|
||||||
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
if (isSelfUpdate || qualifiedCallbacks.length > 0) {
|
||||||
const disposer = this.disposeMap.get(acceptedPath);
|
const disposer = this.disposeMap.get(acceptedPath);
|
||||||
disposer && await disposer(this.dataMap.get(acceptedPath));
|
disposer && await disposer(this.dataMap.get(acceptedPath));
|
||||||
|
|
@ -509,22 +500,18 @@ class HMRClient {
|
||||||
}
|
}
|
||||||
return () => {
|
return () => {
|
||||||
for (const { deps, fn } of qualifiedCallbacks)
|
for (const { deps, fn } of qualifiedCallbacks)
|
||||||
fn(
|
fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
|
||||||
deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0)
|
|
||||||
);
|
|
||||||
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
const loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
|
||||||
this.logger.debug(`[vite] hot updated: ${loggedPath}`);
|
this.logger.debug(`[vite] hot updated: ${loggedPath}`);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
|
function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
|
||||||
if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
|
if (!metadata?.isDynamicImport && moduleType !== "module" && metadata?.importedNames?.length) {
|
||||||
const missingBindings = metadata.importedNames.filter((s) => !(s in mod));
|
const missingBindings = metadata.importedNames.filter((s) => !(s in mod));
|
||||||
if (missingBindings.length) {
|
if (missingBindings.length) {
|
||||||
const lastBinding = missingBindings[missingBindings.length - 1];
|
const lastBinding = missingBindings[missingBindings.length - 1];
|
||||||
throw moduleType === "module" ? new SyntaxError(
|
throw new SyntaxError(`[vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
|
||||||
`[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'`
|
|
||||||
) : new SyntaxError(`[vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
|
|
||||||
CommonJS modules can always be imported via the default export, for example using:
|
CommonJS modules can always be imported via the default export, for example using:
|
||||||
|
|
||||||
import pkg from '${rawId}';
|
import pkg from '${rawId}';
|
||||||
|
|
@ -533,6 +520,15 @@ const {${missingBindings.join(", ")}} = pkg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function proxyGuardOnlyEsm(mod, rawId, metadata) {
|
||||||
|
return metadata?.importedNames?.length ? new Proxy(mod, {
|
||||||
|
get(mod2, prop) {
|
||||||
|
if (prop !== "then" && !(prop in mod2))
|
||||||
|
throw new SyntaxError(`[vite] The requested module '${rawId}' does not provide an export named '${prop.toString()}'`);
|
||||||
|
return mod2[prop];
|
||||||
|
}
|
||||||
|
}) : mod;
|
||||||
|
}
|
||||||
const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {
|
const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {
|
||||||
}, silentConsole = {
|
}, silentConsole = {
|
||||||
debug: noop,
|
debug: noop,
|
||||||
|
|
@ -550,28 +546,23 @@ async function handleHMRPayload(runtime, payload) {
|
||||||
hmrClient.logger.debug("[vite] connected."), hmrClient.messenger.flush();
|
hmrClient.logger.debug("[vite] connected."), hmrClient.messenger.flush();
|
||||||
break;
|
break;
|
||||||
case "update":
|
case "update":
|
||||||
await hmrClient.notifyListeners("vite:beforeUpdate", payload), await Promise.all(
|
await hmrClient.notifyListeners("vite:beforeUpdate", payload), await Promise.all(payload.updates.map(async (update) => {
|
||||||
payload.updates.map(async (update) => {
|
if (update.type === "js-update")
|
||||||
if (update.type === "js-update")
|
return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);
|
||||||
return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);
|
hmrClient.logger.error("[vite] css hmr is not supported in runtime mode.");
|
||||||
hmrClient.logger.error(
|
})), await hmrClient.notifyListeners("vite:afterUpdate", payload);
|
||||||
"[vite] css hmr is not supported in runtime mode."
|
|
||||||
);
|
|
||||||
})
|
|
||||||
), await hmrClient.notifyListeners("vite:afterUpdate", payload);
|
|
||||||
break;
|
break;
|
||||||
case "custom": {
|
case "custom": {
|
||||||
await hmrClient.notifyListeners(payload.event, payload.data);
|
await hmrClient.notifyListeners(payload.event, payload.data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "full-reload": {
|
case "full-reload": {
|
||||||
const { triggeredBy } = payload, clearEntrypoints = triggeredBy ? [...runtime.entrypoints].filter(
|
const { triggeredBy } = payload, clearEntrypoints = triggeredBy ? [...runtime.entrypoints].filter((entrypoint) => runtime.moduleCache.isImported({
|
||||||
(entrypoint) => runtime.moduleCache.isImported({
|
importedId: triggeredBy,
|
||||||
importedId: triggeredBy,
|
importedBy: entrypoint
|
||||||
importedBy: entrypoint
|
})) : [...runtime.entrypoints];
|
||||||
})
|
if (!clearEntrypoints.length)
|
||||||
) : [...runtime.entrypoints];
|
break;
|
||||||
if (!clearEntrypoints.length) break;
|
|
||||||
hmrClient.logger.debug("[vite] program reload"), await hmrClient.notifyListeners("vite:beforeFullReload", payload), runtime.moduleCache.clear();
|
hmrClient.logger.debug("[vite] program reload"), await hmrClient.notifyListeners("vite:beforeFullReload", payload), runtime.moduleCache.clear();
|
||||||
for (const id of clearEntrypoints)
|
for (const id of clearEntrypoints)
|
||||||
await runtime.executeUrl(id);
|
await runtime.executeUrl(id);
|
||||||
|
|
@ -583,11 +574,9 @@ async function handleHMRPayload(runtime, payload) {
|
||||||
case "error": {
|
case "error": {
|
||||||
await hmrClient.notifyListeners("vite:error", payload);
|
await hmrClient.notifyListeners("vite:error", payload);
|
||||||
const err = payload.err;
|
const err = payload.err;
|
||||||
hmrClient.logger.error(
|
hmrClient.logger.error(`[vite] Internal Server Error
|
||||||
`[vite] Internal Server Error
|
|
||||||
${err.message}
|
${err.message}
|
||||||
${err.stack}`
|
${err.stack}`);
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
@ -618,12 +607,11 @@ class Queue {
|
||||||
const sourceMapCache = {}, fileContentsCache = {}, moduleGraphs = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => (...args) => {
|
const sourceMapCache = {}, fileContentsCache = {}, moduleGraphs = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => (...args) => {
|
||||||
for (const handler of handlers) {
|
for (const handler of handlers) {
|
||||||
const result = handler(...args);
|
const result = handler(...args);
|
||||||
if (result) return result;
|
if (result)
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}, retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(
|
}, retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers);
|
||||||
retrieveSourceMapHandlers
|
|
||||||
);
|
|
||||||
let overridden = !1;
|
let overridden = !1;
|
||||||
const originalPrepare = Error.prepareStackTrace;
|
const originalPrepare = Error.prepareStackTrace;
|
||||||
function resetInterceptor(runtime, options) {
|
function resetInterceptor(runtime, options) {
|
||||||
|
|
@ -633,7 +621,8 @@ function interceptStackTrace(runtime, options = {}) {
|
||||||
return overridden || (Error.prepareStackTrace = prepareStackTrace, overridden = !0), moduleGraphs.add(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runtime, options);
|
return overridden || (Error.prepareStackTrace = prepareStackTrace, overridden = !0), moduleGraphs.add(runtime.moduleCache), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runtime, options);
|
||||||
}
|
}
|
||||||
function supportRelativeURL(file, url) {
|
function supportRelativeURL(file, url) {
|
||||||
if (!file) return url;
|
if (!file)
|
||||||
|
return url;
|
||||||
const dir = posixDirname(slash(file)), match = /^\w+:\/\/[^/]*/.exec(dir);
|
const dir = posixDirname(slash(file)), match = /^\w+:\/\/[^/]*/.exec(dir);
|
||||||
let protocol = match ? match[0] : "";
|
let protocol = match ? match[0] : "";
|
||||||
const startPath = dir.slice(protocol.length);
|
const startPath = dir.slice(protocol.length);
|
||||||
|
|
@ -652,24 +641,29 @@ function getRuntimeSourceMap(position) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
function retrieveFile(path) {
|
function retrieveFile(path) {
|
||||||
if (path in fileContentsCache) return fileContentsCache[path];
|
if (path in fileContentsCache)
|
||||||
|
return fileContentsCache[path];
|
||||||
const content = retrieveFileFromHandlers(path);
|
const content = retrieveFileFromHandlers(path);
|
||||||
return typeof content == "string" ? (fileContentsCache[path] = content, content) : null;
|
return typeof content == "string" ? (fileContentsCache[path] = content, content) : null;
|
||||||
}
|
}
|
||||||
function retrieveSourceMapURL(source) {
|
function retrieveSourceMapURL(source) {
|
||||||
const fileData = retrieveFile(source);
|
const fileData = retrieveFile(source);
|
||||||
if (!fileData) return null;
|
if (!fileData)
|
||||||
|
return null;
|
||||||
const re = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm;
|
const re = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm;
|
||||||
let lastMatch, match;
|
let lastMatch, match;
|
||||||
for (; match = re.exec(fileData); ) lastMatch = match;
|
for (; match = re.exec(fileData); )
|
||||||
|
lastMatch = match;
|
||||||
return lastMatch ? lastMatch[1] : null;
|
return lastMatch ? lastMatch[1] : null;
|
||||||
}
|
}
|
||||||
const reSourceMap = /^data:application\/json[^,]+base64,/;
|
const reSourceMap = /^data:application\/json[^,]+base64,/;
|
||||||
function retrieveSourceMap(source) {
|
function retrieveSourceMap(source) {
|
||||||
const urlAndMap = retrieveSourceMapFromHandlers(source);
|
const urlAndMap = retrieveSourceMapFromHandlers(source);
|
||||||
if (urlAndMap) return urlAndMap;
|
if (urlAndMap)
|
||||||
|
return urlAndMap;
|
||||||
let sourceMappingURL = retrieveSourceMapURL(source);
|
let sourceMappingURL = retrieveSourceMapURL(source);
|
||||||
if (!sourceMappingURL) return null;
|
if (!sourceMappingURL)
|
||||||
|
return null;
|
||||||
let sourceMapData;
|
let sourceMapData;
|
||||||
if (reSourceMap.test(sourceMappingURL)) {
|
if (reSourceMap.test(sourceMappingURL)) {
|
||||||
const rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
|
const rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
|
||||||
|
|
@ -682,7 +676,8 @@ function retrieveSourceMap(source) {
|
||||||
} : null;
|
} : null;
|
||||||
}
|
}
|
||||||
function mapSourcePosition(position) {
|
function mapSourcePosition(position) {
|
||||||
if (!position.source) return position;
|
if (!position.source)
|
||||||
|
return position;
|
||||||
let sourceMap = getRuntimeSourceMap(position);
|
let sourceMap = getRuntimeSourceMap(position);
|
||||||
if (sourceMap || (sourceMap = sourceMapCache[position.source]), !sourceMap) {
|
if (sourceMap || (sourceMap = sourceMapCache[position.source]), !sourceMap) {
|
||||||
const urlAndMap = retrieveSourceMap(position.source);
|
const urlAndMap = retrieveSourceMap(position.source);
|
||||||
|
|
@ -690,10 +685,7 @@ function mapSourcePosition(position) {
|
||||||
const url = urlAndMap.url;
|
const url = urlAndMap.url;
|
||||||
sourceMap = sourceMapCache[position.source] = {
|
sourceMap = sourceMapCache[position.source] = {
|
||||||
url,
|
url,
|
||||||
map: new DecodedMap(
|
map: new DecodedMap(typeof urlAndMap.map == "string" ? JSON.parse(urlAndMap.map) : urlAndMap.map, url)
|
||||||
typeof urlAndMap.map == "string" ? JSON.parse(urlAndMap.map) : urlAndMap.map,
|
|
||||||
url
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
const contents = sourceMap.map?.map.sourcesContent;
|
const contents = sourceMap.map?.map.sourcesContent;
|
||||||
sourceMap.map && contents && sourceMap.map.resolvedSources.forEach((source, i) => {
|
sourceMap.map && contents && sourceMap.map.resolvedSources.forEach((source, i) => {
|
||||||
|
|
@ -712,10 +704,7 @@ function mapSourcePosition(position) {
|
||||||
if (sourceMap && sourceMap.map && sourceMap.url) {
|
if (sourceMap && sourceMap.map && sourceMap.url) {
|
||||||
const originalPosition = getOriginalPosition(sourceMap.map, position);
|
const originalPosition = getOriginalPosition(sourceMap.map, position);
|
||||||
if (originalPosition && originalPosition.source != null)
|
if (originalPosition && originalPosition.source != null)
|
||||||
return originalPosition.source = supportRelativeURL(
|
return originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source), sourceMap.vite && (originalPosition._vite = !0), originalPosition;
|
||||||
sourceMap.url,
|
|
||||||
originalPosition.source
|
|
||||||
), sourceMap.vite && (originalPosition._vite = !0), originalPosition;
|
|
||||||
}
|
}
|
||||||
return position;
|
return position;
|
||||||
}
|
}
|
||||||
|
|
@ -749,14 +738,13 @@ function CallSiteToString() {
|
||||||
const functionName = this.getFunctionName();
|
const functionName = this.getFunctionName();
|
||||||
let addSuffix = !0;
|
let addSuffix = !0;
|
||||||
const isConstructor = this.isConstructor();
|
const isConstructor = this.isConstructor();
|
||||||
if (this.isToplevel() || isConstructor)
|
if (!(this.isToplevel() || isConstructor)) {
|
||||||
isConstructor ? line += `new ${functionName || "<anonymous>"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);
|
|
||||||
else {
|
|
||||||
let typeName = this.getTypeName();
|
let typeName = this.getTypeName();
|
||||||
typeName === "[object Object]" && (typeName = "null");
|
typeName === "[object Object]" && (typeName = "null");
|
||||||
const methodName = this.getMethodName();
|
const methodName = this.getMethodName();
|
||||||
functionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || "<anonymous>"}`;
|
functionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || "<anonymous>"}`;
|
||||||
}
|
} else
|
||||||
|
isConstructor ? line += `new ${functionName || "<anonymous>"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);
|
||||||
return addSuffix && (line += ` (${fileLocation})`), line;
|
return addSuffix && (line += ` (${fileLocation})`), line;
|
||||||
}
|
}
|
||||||
function cloneCallSite(frame) {
|
function cloneCallSite(frame) {
|
||||||
|
|
@ -813,29 +801,18 @@ function prepareStackTrace(error, stack) {
|
||||||
function enableSourceMapSupport(runtime) {
|
function enableSourceMapSupport(runtime) {
|
||||||
if (runtime.options.sourcemapInterceptor === "node") {
|
if (runtime.options.sourcemapInterceptor === "node") {
|
||||||
if (typeof process > "u")
|
if (typeof process > "u")
|
||||||
throw new TypeError(
|
throw new TypeError(`Cannot use "sourcemapInterceptor: 'node'" because global "process" variable is not available.`);
|
||||||
`Cannot use "sourcemapInterceptor: 'node'" because global "process" variable is not available.`
|
|
||||||
);
|
|
||||||
if (typeof process.setSourceMapsEnabled != "function")
|
if (typeof process.setSourceMapsEnabled != "function")
|
||||||
throw new TypeError(
|
throw new TypeError(`Cannot use "sourcemapInterceptor: 'node'" because "process.setSourceMapsEnabled" function is not available. Please use Node >= 16.6.0.`);
|
||||||
`Cannot use "sourcemapInterceptor: 'node'" because "process.setSourceMapsEnabled" function is not available. Please use Node >= 16.6.0.`
|
|
||||||
);
|
|
||||||
const isEnabledAlready = process.sourceMapsEnabled ?? !1;
|
const isEnabledAlready = process.sourceMapsEnabled ?? !1;
|
||||||
return process.setSourceMapsEnabled(!0), () => !isEnabledAlready && process.setSourceMapsEnabled(!1);
|
return process.setSourceMapsEnabled(!0), () => !isEnabledAlready && process.setSourceMapsEnabled(!1);
|
||||||
}
|
}
|
||||||
return interceptStackTrace(
|
return interceptStackTrace(runtime, typeof runtime.options.sourcemapInterceptor == "object" ? runtime.options.sourcemapInterceptor : void 0);
|
||||||
runtime,
|
|
||||||
typeof runtime.options.sourcemapInterceptor == "object" ? runtime.options.sourcemapInterceptor : void 0
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
class ViteRuntime {
|
class ViteRuntime {
|
||||||
constructor(options, runner, debug) {
|
options;
|
||||||
this.options = options, this.runner = runner, this.debug = debug, this.moduleCache = options.moduleCache ?? new ModuleCacheMap(options.root), typeof options.hmr == "object" && (this.hmrClient = new HMRClient(
|
runner;
|
||||||
options.hmr.logger === !1 ? silentConsole : options.hmr.logger || console,
|
debug;
|
||||||
options.hmr.connection,
|
|
||||||
({ acceptedPath, ssrInvalidates }) => (this.moduleCache.invalidate(acceptedPath), ssrInvalidates && this.invalidateFiles(ssrInvalidates), this.executeUrl(acceptedPath))
|
|
||||||
), options.hmr.connection.onUpdate(createHMRHandler(this))), options.sourcemapInterceptor !== !1 && (this._resetSourceMapSupport = enableSourceMapSupport(this));
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Holds the cache of modules
|
* Holds the cache of modules
|
||||||
* Keys of the map are ids
|
* Keys of the map are ids
|
||||||
|
|
@ -847,13 +824,14 @@ class ViteRuntime {
|
||||||
fileToIdMap = /* @__PURE__ */ new Map();
|
fileToIdMap = /* @__PURE__ */ new Map();
|
||||||
envProxy = new Proxy({}, {
|
envProxy = new Proxy({}, {
|
||||||
get(_, p) {
|
get(_, p) {
|
||||||
throw new Error(
|
throw new Error(`[vite-runtime] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
|
||||||
`[vite-runtime] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
_destroyed = !1;
|
_destroyed = !1;
|
||||||
_resetSourceMapSupport;
|
_resetSourceMapSupport;
|
||||||
|
constructor(options, runner, debug) {
|
||||||
|
this.options = options, this.runner = runner, this.debug = debug, this.moduleCache = options.moduleCache ?? new ModuleCacheMap(options.root), typeof options.hmr == "object" && (this.hmrClient = new HMRClient(options.hmr.logger === !1 ? silentConsole : options.hmr.logger || console, options.hmr.connection, ({ acceptedPath, ssrInvalidates }) => (this.moduleCache.invalidate(acceptedPath), ssrInvalidates && this.invalidateFiles(ssrInvalidates), this.executeUrl(acceptedPath))), options.hmr.connection.onUpdate(createHMRHandler(this))), options.sourcemapInterceptor !== !1 && (this._resetSourceMapSupport = enableSourceMapSupport(this));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* URL to execute. Accepts file path, server path or id relative to the root.
|
* URL to execute. Accepts file path, server path or id relative to the root.
|
||||||
*/
|
*/
|
||||||
|
|
@ -913,7 +891,7 @@ class ViteRuntime {
|
||||||
if (!("externalize" in fetchResult))
|
if (!("externalize" in fetchResult))
|
||||||
return exports;
|
return exports;
|
||||||
const { id, type } = fetchResult;
|
const { id, type } = fetchResult;
|
||||||
return type !== "module" && type !== "commonjs" || analyzeImportedModDifference(exports, id, type, metadata), exports;
|
return type !== "module" && type !== "commonjs" ? exports : (analyzeImportedModDifference(exports, id, type, metadata), proxyGuardOnlyEsm(exports, id, metadata));
|
||||||
}
|
}
|
||||||
async cachedRequest(id, fetchedModule, callstack = [], metadata) {
|
async cachedRequest(id, fetchedModule, callstack = [], metadata) {
|
||||||
const moduleId = fetchedModule.id;
|
const moduleId = fetchedModule.id;
|
||||||
|
|
@ -926,10 +904,8 @@ class ViteRuntime {
|
||||||
const getStack = () => `stack:
|
const getStack = () => `stack:
|
||||||
${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join(`
|
${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join(`
|
||||||
`)}`;
|
`)}`;
|
||||||
this.debug(
|
this.debug(`[vite-runtime] module ${moduleId} takes over 2s to load.
|
||||||
`[vite-runtime] module ${moduleId} takes over 2s to load.
|
${getStack()}`);
|
||||||
${getStack()}`
|
|
||||||
);
|
|
||||||
}, 2e3));
|
}, 2e3));
|
||||||
try {
|
try {
|
||||||
if (mod.promise)
|
if (mod.promise)
|
||||||
|
|
@ -972,9 +948,7 @@ ${getStack()}`
|
||||||
const { code, file } = fetchResult;
|
const { code, file } = fetchResult;
|
||||||
if (code == null) {
|
if (code == null) {
|
||||||
const importer = callstack[callstack.length - 2];
|
const importer = callstack[callstack.length - 2];
|
||||||
throw new Error(
|
throw new Error(`[vite-runtime] Failed to load "${id}"${importer ? ` imported from ${importer}` : ""}`);
|
||||||
`[vite-runtime] Failed to load "${id}"${importer ? ` imported from ${importer}` : ""}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
const modulePath = cleanUrl(file || moduleId), href = posixPathToFileHref(modulePath), filename = modulePath, dirname2 = posixDirname(modulePath), meta = {
|
const modulePath = cleanUrl(file || moduleId), href = posixPathToFileHref(modulePath), filename = modulePath, dirname2 = posixDirname(modulePath), meta = {
|
||||||
filename: isWindows ? toWindowsPath(filename) : filename,
|
filename: isWindows ? toWindowsPath(filename) : filename,
|
||||||
|
|
@ -982,9 +956,7 @@ ${getStack()}`
|
||||||
url: href,
|
url: href,
|
||||||
env: this.envProxy,
|
env: this.envProxy,
|
||||||
resolve(id2, parent) {
|
resolve(id2, parent) {
|
||||||
throw new Error(
|
throw new Error('[vite-runtime] "import.meta.resolve" is not supported.');
|
||||||
'[vite-runtime] "import.meta.resolve" is not supported.'
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
// should be replaced during transformation
|
// should be replaced during transformation
|
||||||
glob() {
|
glob() {
|
||||||
|
|
@ -1042,13 +1014,7 @@ class ESModulesRunner {
|
||||||
ssrExportAllKey,
|
ssrExportAllKey,
|
||||||
// source map should already be inlined by Vite
|
// source map should already be inlined by Vite
|
||||||
'"use strict";' + code
|
'"use strict";' + code
|
||||||
)(
|
)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey]), Object.seal(context[ssrModuleExportsKey]);
|
||||||
context[ssrModuleExportsKey],
|
|
||||||
context[ssrImportMetaKey],
|
|
||||||
context[ssrImportKey],
|
|
||||||
context[ssrDynamicImportKey],
|
|
||||||
context[ssrExportAllKey]
|
|
||||||
), Object.seal(context[ssrModuleExportsKey]);
|
|
||||||
}
|
}
|
||||||
runExternalModule(filepath) {
|
runExternalModule(filepath) {
|
||||||
return import(filepath);
|
return import(filepath);
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
|
/* eslint-disable no-restricted-globals */
|
||||||
|
|
||||||
warnCjsUsage()
|
warnCjsUsage()
|
||||||
|
|
||||||
// type utils
|
// type utils
|
||||||
module.exports.defineConfig = (config) => config
|
module.exports.defineConfig = (config) => config
|
||||||
|
|
||||||
// proxy cjs utils (sync functions)
|
// proxy cjs utils (sync functions)
|
||||||
|
// eslint-disable-next-line n/no-missing-require -- will be generated by build
|
||||||
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
|
Object.assign(module.exports, require('./dist/node-cjs/publicUtils.cjs'))
|
||||||
|
|
||||||
// async functions, can be redirect from ESM build
|
// async functions, can be redirect from ESM build
|
||||||
|
|
@ -25,36 +28,11 @@ asyncFunctions.forEach((name) => {
|
||||||
|
|
||||||
function warnCjsUsage() {
|
function warnCjsUsage() {
|
||||||
if (process.env.VITE_CJS_IGNORE_WARNING) return
|
if (process.env.VITE_CJS_IGNORE_WARNING) return
|
||||||
const logLevelIndex = process.argv.findIndex((arg) =>
|
|
||||||
/^(?:-l|--logLevel)/.test(arg),
|
|
||||||
)
|
|
||||||
if (logLevelIndex > 0) {
|
|
||||||
const logLevelValue = process.argv[logLevelIndex + 1]
|
|
||||||
if (logLevelValue === 'silent' || logLevelValue === 'error') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (/silent|error/.test(process.argv[logLevelIndex])) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const yellow = (str) => `\u001b[33m${str}\u001b[39m`
|
const yellow = (str) => `\u001b[33m${str}\u001b[39m`
|
||||||
console.warn(
|
const log = process.env.VITE_CJS_TRACE ? console.trace : console.warn
|
||||||
|
log(
|
||||||
yellow(
|
yellow(
|
||||||
`The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`,
|
`The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.`,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
if (process.env.VITE_CJS_TRACE) {
|
|
||||||
const e = {}
|
|
||||||
const stackTraceLimit = Error.stackTraceLimit
|
|
||||||
Error.stackTraceLimit = 100
|
|
||||||
Error.captureStackTrace(e)
|
|
||||||
Error.stackTraceLimit = stackTraceLimit
|
|
||||||
console.log(
|
|
||||||
e.stack
|
|
||||||
.split('\n')
|
|
||||||
.slice(1)
|
|
||||||
.filter((line) => !line.includes('(node:'))
|
|
||||||
.join('\n'),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* @deprecated The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
|
* @deprecated The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
|
||||||
*/
|
*/
|
||||||
declare const module: any
|
declare const module: any
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "vite",
|
"name": "vite",
|
||||||
"version": "5.4.21",
|
"version": "5.2.14",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"author": "Evan You",
|
"author": "Evan You",
|
||||||
|
|
@ -68,30 +68,33 @@
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/vitejs/vite/issues"
|
"url": "https://github.com/vitejs/vite/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://vite.dev",
|
"homepage": "https://vitejs.dev",
|
||||||
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
"funding": "https://github.com/vitejs/vite?sponsor=1",
|
||||||
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.21.3",
|
"esbuild": "^0.20.1",
|
||||||
"postcss": "^8.4.43",
|
"postcss": "^8.4.38",
|
||||||
"rollup": "^4.20.0"
|
"rollup": "^4.13.0"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"fsevents": "~2.3.3"
|
"fsevents": "~2.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ampproject/remapping": "^2.3.0",
|
"@ampproject/remapping": "^2.3.0",
|
||||||
"@babel/parser": "^7.25.6",
|
"@babel/parser": "^7.24.6",
|
||||||
"@jridgewell/trace-mapping": "^0.3.25",
|
"@jridgewell/trace-mapping": "^0.3.25",
|
||||||
"@polka/compression": "^1.0.0-next.25",
|
"@polka/compression": "^1.0.0-next.25",
|
||||||
"@rollup/plugin-alias": "^5.1.0",
|
"@rollup/plugin-alias": "^5.1.0",
|
||||||
"@rollup/plugin-commonjs": "^26.0.1",
|
"@rollup/plugin-commonjs": "^25.0.8",
|
||||||
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
"@rollup/plugin-dynamic-import-vars": "^2.1.2",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "15.2.3",
|
"@rollup/plugin-node-resolve": "15.2.3",
|
||||||
|
"@rollup/plugin-typescript": "^11.1.6",
|
||||||
"@rollup/pluginutils": "^5.1.0",
|
"@rollup/pluginutils": "^5.1.0",
|
||||||
"@types/escape-html": "^1.0.4",
|
"@types/escape-html": "^1.0.4",
|
||||||
"@types/pnpapi": "^0.0.5",
|
"@types/pnpapi": "^0.0.5",
|
||||||
|
"acorn": "^8.11.3",
|
||||||
|
"acorn-walk": "^8.3.2",
|
||||||
"artichokie": "^0.2.1",
|
"artichokie": "^0.2.1",
|
||||||
"cac": "^6.7.14",
|
"cac": "^6.7.14",
|
||||||
"chokidar": "^3.6.0",
|
"chokidar": "^3.6.0",
|
||||||
|
|
@ -99,21 +102,21 @@
|
||||||
"convert-source-map": "^2.0.0",
|
"convert-source-map": "^2.0.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"cross-spawn": "^7.0.3",
|
"cross-spawn": "^7.0.3",
|
||||||
"debug": "^4.3.6",
|
"debug": "^4.3.4",
|
||||||
"dep-types": "link:./src/types",
|
"dep-types": "link:./src/types",
|
||||||
"dotenv": "^16.4.5",
|
"dotenv": "^16.4.5",
|
||||||
"dotenv-expand": "^11.0.6",
|
"dotenv-expand": "^11.0.6",
|
||||||
"es-module-lexer": "^1.5.4",
|
"es-module-lexer": "^1.5.3",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"estree-walker": "^3.0.3",
|
"estree-walker": "^3.0.3",
|
||||||
"etag": "^1.8.1",
|
"etag": "^1.8.1",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"http-proxy": "^1.18.1",
|
"http-proxy": "^1.18.1",
|
||||||
"launch-editor-middleware": "^2.9.1",
|
"launch-editor-middleware": "^2.6.1",
|
||||||
"lightningcss": "^1.26.0",
|
"lightningcss": "^1.25.1",
|
||||||
"magic-string": "^0.30.11",
|
"magic-string": "^0.30.10",
|
||||||
"micromatch": "^4.0.8",
|
"micromatch": "^4.0.7",
|
||||||
"mlly": "^1.7.1",
|
"mlly": "^1.7.0",
|
||||||
"mrmime": "^2.0.0",
|
"mrmime": "^2.0.0",
|
||||||
"open": "^8.4.2",
|
"open": "^8.4.2",
|
||||||
"parse5": "^7.1.2",
|
"parse5": "^7.1.2",
|
||||||
|
|
@ -127,25 +130,23 @@
|
||||||
"resolve.exports": "^2.0.2",
|
"resolve.exports": "^2.0.2",
|
||||||
"rollup-plugin-dts": "^6.1.1",
|
"rollup-plugin-dts": "^6.1.1",
|
||||||
"rollup-plugin-esbuild": "^6.1.1",
|
"rollup-plugin-esbuild": "^6.1.1",
|
||||||
"rollup-plugin-license": "^3.5.2",
|
"rollup-plugin-license": "^3.4.0",
|
||||||
"sass": "^1.77.8",
|
"sass": "^1.77.2",
|
||||||
"sass-embedded": "^1.77.8",
|
|
||||||
"sirv": "^2.0.4",
|
"sirv": "^2.0.4",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"strip-ansi": "^7.1.0",
|
"strip-ansi": "^7.1.0",
|
||||||
"strip-literal": "^2.1.0",
|
"strip-literal": "^2.1.0",
|
||||||
"tsconfck": "^3.1.4",
|
"tsconfck": "^3.0.3",
|
||||||
"tslib": "^2.7.0",
|
"tslib": "^2.6.2",
|
||||||
"types": "link:./types",
|
"types": "link:./types",
|
||||||
"ufo": "^1.5.4",
|
"ufo": "^1.5.3",
|
||||||
"ws": "^8.18.0"
|
"ws": "^8.17.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@types/node": "^18.0.0 || >=20.0.0",
|
"@types/node": "^18.0.0 || >=20.0.0",
|
||||||
"less": "*",
|
"less": "*",
|
||||||
"lightningcss": "^1.21.0",
|
"lightningcss": "^1.21.0",
|
||||||
"sass": "*",
|
"sass": "*",
|
||||||
"sass-embedded": "*",
|
|
||||||
"stylus": "*",
|
"stylus": "*",
|
||||||
"sugarss": "*",
|
"sugarss": "*",
|
||||||
"terser": "^5.4.0"
|
"terser": "^5.4.0"
|
||||||
|
|
@ -157,9 +158,6 @@
|
||||||
"sass": {
|
"sass": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
"sass-embedded": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"stylus": {
|
"stylus": {
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
|
@ -177,12 +175,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "tsx scripts/dev.ts",
|
"dev": "rimraf dist && pnpm run build-bundle -w",
|
||||||
"build": "rimraf dist && run-s build-bundle build-types",
|
"build": "rimraf dist && run-s build-bundle build-types",
|
||||||
"build-bundle": "rollup --config rollup.config.ts --configPlugin esbuild",
|
"build-bundle": "rollup --config rollup.config.ts --configPlugin typescript",
|
||||||
"build-types": "run-s build-types-temp build-types-roll build-types-check",
|
"build-types": "run-s build-types-temp build-types-roll build-types-check",
|
||||||
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node",
|
"build-types-temp": "tsc --emitDeclarationOnly --outDir temp -p src/node",
|
||||||
"build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin esbuild && rimraf temp",
|
"build-types-roll": "rollup --config rollup.dts.config.ts --configPlugin typescript && rimraf temp",
|
||||||
"build-types-check": "tsc --project tsconfig.check.json",
|
"build-types-check": "tsc --project tsconfig.check.json",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"lint": "eslint --cache --ext .ts src/**",
|
"lint": "eslint --cache --ext .ts src/**",
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"dev:simple": "node dev-server.mjs",
|
"dev:simple": "node dev-server.mjs",
|
||||||
"build": "vue-tsc -b && vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"test": "vitest",
|
"test": "vitest",
|
||||||
"test:e2e": "playwright test"
|
"test:e2e": "playwright test"
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ const fetchPermissions = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await getPermissions()
|
const res = await getPermissions()
|
||||||
permissions.value = res.data || []
|
permissions.value = res.data.data || []
|
||||||
pagination.total = permissions.value.length
|
pagination.total = permissions.value.length
|
||||||
} catch {
|
} catch {
|
||||||
message.error('获取权限列表失败')
|
message.error('获取权限列表失败')
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ const fetchRoles = async () => {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await getRoles()
|
const res = await getRoles()
|
||||||
roles.value = res.data
|
roles.value = res.data.data || []
|
||||||
} catch {
|
} catch {
|
||||||
message.error('获取角色列表失败')
|
message.error('获取角色列表失败')
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ const fetchUsers = async () => {
|
||||||
if (searchKeyword.value) params.keyword = searchKeyword.value
|
if (searchKeyword.value) params.keyword = searchKeyword.value
|
||||||
if (searchStatus.value) params.status = searchStatus.value
|
if (searchStatus.value) params.status = searchStatus.value
|
||||||
const res = await getUsers(params)
|
const res = await getUsers(params)
|
||||||
users.value = res.data
|
users.value = res.data.data || []
|
||||||
} catch {
|
} catch {
|
||||||
message.error('获取用户列表失败')
|
message.error('获取用户列表失败')
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue