@voidzero-dev/vite-plus-core 0.1.15-alpha.1 → 0.1.15-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tsdown/build-D-zhBXEK-DEzF_gsh.js +2 -0
- package/dist/tsdown/{build-DpU0PBVv-CUY7qeWj.js → build-DpU0PBVv-DmeUpIF7.js} +43 -43
- package/dist/tsdown/{dist-dJp148cE.js → dist-CtF_Stv5.js} +3 -3
- package/dist/tsdown/{dist-BkOM3Vdg.js → dist-mVbiy67d.js} +12 -12
- package/dist/tsdown/index.js +1 -1
- package/dist/tsdown/run.js +1 -1
- package/dist/vite/node/chunks/logger.js +1 -1
- package/dist/vite/node/chunks/node.js +48 -28
- package/dist/vite/node/module-runner.js +9 -5
- package/package.json +3 -3
- package/dist/tsdown/build-D-zhBXEK-X12uvwLb.js +0 -2
|
@@ -17,7 +17,7 @@ import path$1, { basename, dirname as dirname$1, normalize as normalize$1, posix
|
|
|
17
17
|
import { fileURLToPath as fileURLToPath$1 } from "url";
|
|
18
18
|
import { createRequire as createRequire$1 } from "module";
|
|
19
19
|
import { tmpdir } from "node:os";
|
|
20
|
-
import
|
|
20
|
+
import re, { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
21
21
|
import { Buffer } from "node:buffer";
|
|
22
22
|
import { brotliCompress, gzip } from "node:zlib";
|
|
23
23
|
import { importGlobPlugin } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
@@ -3178,87 +3178,87 @@ quansync$1({
|
|
|
3178
3178
|
*/
|
|
3179
3179
|
const quansync = quansync$1;
|
|
3180
3180
|
quansync$1({
|
|
3181
|
-
sync:
|
|
3182
|
-
async:
|
|
3181
|
+
sync: re.readFileSync,
|
|
3182
|
+
async: re.promises.readFile
|
|
3183
3183
|
});
|
|
3184
3184
|
quansync$1({
|
|
3185
|
-
sync:
|
|
3186
|
-
async:
|
|
3185
|
+
sync: re.writeFileSync,
|
|
3186
|
+
async: re.promises.writeFile
|
|
3187
3187
|
});
|
|
3188
3188
|
quansync$1({
|
|
3189
|
-
sync:
|
|
3190
|
-
async:
|
|
3189
|
+
sync: re.unlinkSync,
|
|
3190
|
+
async: re.promises.unlink
|
|
3191
3191
|
});
|
|
3192
3192
|
quansync$1({
|
|
3193
|
-
sync:
|
|
3194
|
-
async:
|
|
3193
|
+
sync: re.accessSync,
|
|
3194
|
+
async: re.promises.access
|
|
3195
3195
|
});
|
|
3196
3196
|
/**
|
|
3197
3197
|
* @link https://nodejs.org/api/fs.html#fspromisesstatpath-options
|
|
3198
3198
|
*/
|
|
3199
3199
|
const stat$1 = quansync$1({
|
|
3200
|
-
sync:
|
|
3201
|
-
async:
|
|
3200
|
+
sync: re.statSync,
|
|
3201
|
+
async: re.promises.stat
|
|
3202
3202
|
});
|
|
3203
3203
|
const lstat = quansync$1({
|
|
3204
|
-
sync:
|
|
3205
|
-
async:
|
|
3204
|
+
sync: re.lstatSync,
|
|
3205
|
+
async: re.promises.lstat
|
|
3206
3206
|
});
|
|
3207
3207
|
quansync$1({
|
|
3208
|
-
sync:
|
|
3209
|
-
async:
|
|
3208
|
+
sync: re.copyFileSync,
|
|
3209
|
+
async: re.promises.copyFile
|
|
3210
3210
|
});
|
|
3211
3211
|
quansync$1({
|
|
3212
|
-
sync:
|
|
3213
|
-
async:
|
|
3212
|
+
sync: re.rmSync,
|
|
3213
|
+
async: re.promises.rm
|
|
3214
3214
|
});
|
|
3215
3215
|
quansync$1({
|
|
3216
|
-
sync:
|
|
3217
|
-
async:
|
|
3216
|
+
sync: re.mkdirSync,
|
|
3217
|
+
async: re.promises.mkdir
|
|
3218
3218
|
});
|
|
3219
3219
|
quansync$1({
|
|
3220
|
-
sync:
|
|
3221
|
-
async:
|
|
3220
|
+
sync: re.renameSync,
|
|
3221
|
+
async: re.promises.rename
|
|
3222
3222
|
});
|
|
3223
3223
|
quansync$1({
|
|
3224
|
-
sync:
|
|
3225
|
-
async:
|
|
3224
|
+
sync: re.readdirSync,
|
|
3225
|
+
async: re.promises.readdir
|
|
3226
3226
|
});
|
|
3227
3227
|
quansync$1({
|
|
3228
|
-
sync:
|
|
3229
|
-
async:
|
|
3228
|
+
sync: re.realpathSync,
|
|
3229
|
+
async: re.promises.realpath
|
|
3230
3230
|
});
|
|
3231
3231
|
quansync$1({
|
|
3232
|
-
sync:
|
|
3233
|
-
async:
|
|
3232
|
+
sync: re.readlinkSync,
|
|
3233
|
+
async: re.promises.readlink
|
|
3234
3234
|
});
|
|
3235
3235
|
quansync$1({
|
|
3236
|
-
sync:
|
|
3237
|
-
async:
|
|
3236
|
+
sync: re.symlinkSync,
|
|
3237
|
+
async: re.promises.symlink
|
|
3238
3238
|
});
|
|
3239
3239
|
quansync$1({
|
|
3240
|
-
sync:
|
|
3241
|
-
async:
|
|
3240
|
+
sync: re.chownSync,
|
|
3241
|
+
async: re.promises.chown
|
|
3242
3242
|
});
|
|
3243
3243
|
quansync$1({
|
|
3244
|
-
sync:
|
|
3245
|
-
async:
|
|
3244
|
+
sync: re.lchownSync,
|
|
3245
|
+
async: re.promises.lchown
|
|
3246
3246
|
});
|
|
3247
3247
|
quansync$1({
|
|
3248
|
-
sync:
|
|
3249
|
-
async:
|
|
3248
|
+
sync: re.chmodSync,
|
|
3249
|
+
async: re.promises.chmod
|
|
3250
3250
|
});
|
|
3251
3251
|
quansync$1({
|
|
3252
|
-
sync:
|
|
3253
|
-
async:
|
|
3252
|
+
sync: re.utimesSync,
|
|
3253
|
+
async: re.promises.utimes
|
|
3254
3254
|
});
|
|
3255
3255
|
quansync$1({
|
|
3256
|
-
sync:
|
|
3257
|
-
async:
|
|
3256
|
+
sync: re.lutimesSync,
|
|
3257
|
+
async: re.promises.lutimes
|
|
3258
3258
|
});
|
|
3259
3259
|
quansync$1({
|
|
3260
|
-
sync:
|
|
3261
|
-
async:
|
|
3260
|
+
sync: re.mkdtempSync,
|
|
3261
|
+
async: re.promises.mkdtemp
|
|
3262
3262
|
});
|
|
3263
3263
|
//#endregion
|
|
3264
3264
|
//#region ../../node_modules/.pnpm/unconfig-core@7.5.0/node_modules/unconfig-core/dist/index.mjs
|
|
@@ -3901,7 +3901,7 @@ async function nativeImport(id) {
|
|
|
3901
3901
|
return mod.default || mod;
|
|
3902
3902
|
}
|
|
3903
3903
|
async function unrunImport(id) {
|
|
3904
|
-
const { unrun } = await import("./dist-
|
|
3904
|
+
const { unrun } = await import("./dist-mVbiy67d.js");
|
|
3905
3905
|
const { module } = await unrun({ path: pathToFileURL(id).href });
|
|
3906
3906
|
return module;
|
|
3907
3907
|
}
|
|
@@ -4903,7 +4903,7 @@ async function resolveInputOptions(config, format, configFiles, bundle, cjsDts,
|
|
|
4903
4903
|
if (nodeProtocol) plugins.push(NodeProtocolPlugin(nodeProtocol));
|
|
4904
4904
|
if (config.pkg || config.deps.skipNodeModulesBundle) plugins.push(DepsPlugin(config, bundle));
|
|
4905
4905
|
if (dts) {
|
|
4906
|
-
const { dts: dtsPlugin } = await import("./dist-
|
|
4906
|
+
const { dts: dtsPlugin } = await import("./dist-CtF_Stv5.js");
|
|
4907
4907
|
const options = {
|
|
4908
4908
|
tsconfig,
|
|
4909
4909
|
...dts
|
|
@@ -11,7 +11,7 @@ import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filte
|
|
|
11
11
|
import nativeFs from "fs";
|
|
12
12
|
import path$1 from "path";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
|
-
import
|
|
14
|
+
import re, { existsSync } from "node:fs";
|
|
15
15
|
import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
16
16
|
import Be from "os";
|
|
17
17
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
@@ -30356,11 +30356,11 @@ function h(e) {
|
|
|
30356
30356
|
}
|
|
30357
30357
|
i(h, "slash");
|
|
30358
30358
|
const Z = i((e) => {
|
|
30359
|
-
const t =
|
|
30359
|
+
const t = re[e];
|
|
30360
30360
|
return (s, ...n) => {
|
|
30361
30361
|
const o = `${e}:${n.join(":")}`;
|
|
30362
30362
|
let l = s == null ? void 0 : s.get(o);
|
|
30363
|
-
return l === void 0 && (l = Reflect.apply(t,
|
|
30363
|
+
return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
|
|
30364
30364
|
};
|
|
30365
30365
|
}, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
|
|
30366
30366
|
for (;;) {
|
|
@@ -5,7 +5,7 @@ import "node:child_process";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { rolldown } from "@voidzero-dev/vite-plus-core/rolldown";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
|
-
import
|
|
8
|
+
import re, { existsSync } from "node:fs";
|
|
9
9
|
import { Buffer } from "node:buffer";
|
|
10
10
|
import crypto from "node:crypto";
|
|
11
11
|
//#region ../../node_modules/.pnpm/unrun@0.2.33/node_modules/unrun/dist/src-GU5PtktT.mjs
|
|
@@ -54,7 +54,7 @@ function resolveOptions(options = {}) {
|
|
|
54
54
|
inputOptions: options.inputOptions,
|
|
55
55
|
outputOptions: options.outputOptions
|
|
56
56
|
};
|
|
57
|
-
if (!
|
|
57
|
+
if (!re.existsSync(resolvedOptions.path)) throw new Error(`[unrun] File not found: ${resolvedOptions.path}`);
|
|
58
58
|
if (!new Set([
|
|
59
59
|
"none",
|
|
60
60
|
"jiti",
|
|
@@ -268,7 +268,7 @@ function createJsonLoader() {
|
|
|
268
268
|
let isRequire = false;
|
|
269
269
|
try {
|
|
270
270
|
if (importer) {
|
|
271
|
-
const src =
|
|
271
|
+
const src = re.readFileSync(importer, "utf8");
|
|
272
272
|
const escaped = source.replaceAll(/[.*+?^${}()|[\]\\]/g, (m) => `\\${m}`);
|
|
273
273
|
const pattern = String.raw`\brequire\s*\(\s*['"]${escaped}['"]\s*\)`;
|
|
274
274
|
isRequire = new RegExp(pattern).test(src);
|
|
@@ -281,7 +281,7 @@ function createJsonLoader() {
|
|
|
281
281
|
handler(id) {
|
|
282
282
|
try {
|
|
283
283
|
const realId = id.replace(/\?unrun-json\.(?:mjs|cjs)$/, "");
|
|
284
|
-
const src =
|
|
284
|
+
const src = re.readFileSync(realId, "utf8");
|
|
285
285
|
const data = JSON.parse(src);
|
|
286
286
|
const jsonLiteral = JSON.stringify(data);
|
|
287
287
|
if (id.endsWith("?unrun-json.cjs")) return { code: `const __data = ${jsonLiteral}\ntry { Object.defineProperty(__data, 'default', { value: __data, enumerable: false, configurable: true }) } catch {}\nmodule.exports = __data\n` };
|
|
@@ -375,7 +375,7 @@ function createRequireResolveFix(options) {
|
|
|
375
375
|
".cjs"
|
|
376
376
|
]) {
|
|
377
377
|
const testPath = path.resolve(baseDir, id + ext);
|
|
378
|
-
if (
|
|
378
|
+
if (re.existsSync(testPath)) return JSON.stringify(testPath);
|
|
379
379
|
}
|
|
380
380
|
const resolvedPath = path.resolve(baseDir, id);
|
|
381
381
|
return JSON.stringify(resolvedPath);
|
|
@@ -416,7 +416,7 @@ function createSourceContextShimsPlugin() {
|
|
|
416
416
|
const normalizedPhysicalId = path.normalize(physicalId);
|
|
417
417
|
let code;
|
|
418
418
|
try {
|
|
419
|
-
code =
|
|
419
|
+
code = re.readFileSync(normalizedPhysicalId, "utf8");
|
|
420
420
|
} catch {
|
|
421
421
|
return null;
|
|
422
422
|
}
|
|
@@ -658,7 +658,7 @@ function cleanModule(moduleUrl, options) {
|
|
|
658
658
|
try {
|
|
659
659
|
if (moduleUrl.startsWith("file://")) {
|
|
660
660
|
const filePath = new URL(moduleUrl);
|
|
661
|
-
|
|
661
|
+
re.unlinkSync(filePath);
|
|
662
662
|
}
|
|
663
663
|
} catch (error) {
|
|
664
664
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -682,14 +682,14 @@ function writeModule(code, options) {
|
|
|
682
682
|
const projectNodeModules = path.join(process.cwd(), "node_modules");
|
|
683
683
|
const outDir = path.join(projectNodeModules, ".unrun");
|
|
684
684
|
const outFile = path.join(outDir, fname);
|
|
685
|
-
if (!
|
|
686
|
-
|
|
687
|
-
|
|
685
|
+
if (!re.existsSync(outFile)) try {
|
|
686
|
+
re.mkdirSync(outDir, { recursive: true });
|
|
687
|
+
re.writeFileSync(outFile, code, "utf8");
|
|
688
688
|
} catch {
|
|
689
689
|
const fallbackDir = path.join(tmpdir(), "unrun-cache");
|
|
690
690
|
const fallbackFile = path.join(fallbackDir, fname);
|
|
691
|
-
|
|
692
|
-
|
|
691
|
+
re.mkdirSync(fallbackDir, { recursive: true });
|
|
692
|
+
re.writeFileSync(fallbackFile, code, "utf8");
|
|
693
693
|
moduleUrl = pathToFileURL(fallbackFile).href;
|
|
694
694
|
}
|
|
695
695
|
moduleUrl = moduleUrl || pathToFileURL(outFile).href;
|
package/dist/tsdown/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as globalLogger } from "./main-BgAbc3Rw.js";
|
|
2
2
|
import { t as enableDebug } from "./debug-C4FmgzkJ-A9B4RM_w.js";
|
|
3
|
-
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-DpU0PBVv-
|
|
3
|
+
import { i as resolveUserConfig, n as buildWithConfigs, r as mergeConfig, t as build$1 } from "./build-DpU0PBVv-DmeUpIF7.js";
|
|
4
4
|
import * as Rolldown from "@voidzero-dev/vite-plus-core/rolldown";
|
|
5
5
|
//#region ../../node_modules/.pnpm/tsdown@0.21.5_@arethetypeswrong+core@0.18.2_@tsdown+css@0.21.5_@tsdown+exe@0.21.5_@type_bddbe1807a7ea96241d07b33ef15a1ae/node_modules/tsdown/dist/config.mjs
|
|
6
6
|
function defineConfig(options) {
|
package/dist/tsdown/run.js
CHANGED
|
@@ -630,7 +630,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
630
630
|
}).option("-c, --config <filename>", "Use a custom config file").option("--config-loader <loader>", "Config loader to use: auto, native, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims ", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: "TSDOWN_" }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
631
631
|
globalLogger.level = flags.logLevel || "info";
|
|
632
632
|
globalLogger.info(`tsdown ${dim`v${version}`} powered by rolldown ${dim`v${VERSION}`}`);
|
|
633
|
-
const { build } = await import("./build-D-zhBXEK-
|
|
633
|
+
const { build } = await import("./build-D-zhBXEK-DEzF_gsh.js");
|
|
634
634
|
if (input.length > 0) flags.entry = input;
|
|
635
635
|
await build(flags);
|
|
636
636
|
});
|
|
@@ -72,7 +72,7 @@ var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
72
72
|
}));
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../vite/packages/vite/package.json
|
|
75
|
-
var version = "8.0.
|
|
75
|
+
var version = "8.0.3";
|
|
76
76
|
//#endregion
|
|
77
77
|
//#region ../../vite/packages/vite/src/node/constants.ts
|
|
78
78
|
const ROLLUP_HOOKS = [
|
|
@@ -16170,6 +16170,7 @@ function isRefIdentifier(id, parent, parentStack) {
|
|
|
16170
16170
|
if (isNodeInPattern(parent) && parent.value === id) return false;
|
|
16171
16171
|
if (parent.type === "ArrayPattern" && !isInDestructuringAssignment(parent, parentStack)) return false;
|
|
16172
16172
|
if (parent.type === "MemberExpression" && parent.property === id && !parent.computed) return false;
|
|
16173
|
+
if (parent.type === "MetaProperty") return false;
|
|
16173
16174
|
if (parent.type === "ExportSpecifier" || parent.type === "ExportAllDeclaration") return false;
|
|
16174
16175
|
if (id.name === "arguments") return false;
|
|
16175
16176
|
return true;
|
|
@@ -27695,6 +27696,40 @@ function handleParseError(parserError, html, filePath, warnings) {
|
|
|
27695
27696
|
warnings[parseError.code] ??= `Unable to parse HTML; ${parseError.message}\n at ${parseError.loc.file}:${parseError.loc.line}:${parseError.loc.column}\n` + parseError.frame;
|
|
27696
27697
|
}
|
|
27697
27698
|
/**
|
|
27699
|
+
* Collects CSS files for a chunk by traversing its imports depth-first,
|
|
27700
|
+
* using a cache to avoid re-analyzing chunks while still returning the
|
|
27701
|
+
* correct files when the same chunk is reached via different entry points.
|
|
27702
|
+
*/
|
|
27703
|
+
function getCssFilesForChunk(chunk, bundle, analyzedImportedCssFiles, seenChunks = /* @__PURE__ */ new Set(), seenCss = /* @__PURE__ */ new Set()) {
|
|
27704
|
+
if (seenChunks.has(chunk.fileName)) return [];
|
|
27705
|
+
seenChunks.add(chunk.fileName);
|
|
27706
|
+
if (analyzedImportedCssFiles.has(chunk)) {
|
|
27707
|
+
const additionals = analyzedImportedCssFiles.get(chunk).filter((file) => !seenCss.has(file));
|
|
27708
|
+
additionals.forEach((file) => seenCss.add(file));
|
|
27709
|
+
return additionals;
|
|
27710
|
+
}
|
|
27711
|
+
const allFiles = [];
|
|
27712
|
+
const filteredFiles = [];
|
|
27713
|
+
chunk.imports.forEach((file) => {
|
|
27714
|
+
const importee = bundle[file];
|
|
27715
|
+
if (importee?.type === "chunk") {
|
|
27716
|
+
const importeeCss = getCssFilesForChunk(importee, bundle, analyzedImportedCssFiles, seenChunks, seenCss);
|
|
27717
|
+
filteredFiles.push(...importeeCss);
|
|
27718
|
+
if (analyzedImportedCssFiles.has(importee)) allFiles.push(...analyzedImportedCssFiles.get(importee));
|
|
27719
|
+
else allFiles.push(...importeeCss);
|
|
27720
|
+
}
|
|
27721
|
+
});
|
|
27722
|
+
chunk.viteMetadata.importedCss.forEach((file) => {
|
|
27723
|
+
allFiles.push(file);
|
|
27724
|
+
if (!seenCss.has(file)) {
|
|
27725
|
+
seenCss.add(file);
|
|
27726
|
+
filteredFiles.push(file);
|
|
27727
|
+
}
|
|
27728
|
+
});
|
|
27729
|
+
analyzedImportedCssFiles.set(chunk, unique(allFiles));
|
|
27730
|
+
return filteredFiles;
|
|
27731
|
+
}
|
|
27732
|
+
/**
|
|
27698
27733
|
* Compiles index.html into an entry js module
|
|
27699
27734
|
*/
|
|
27700
27735
|
function buildHtmlPlugin(config) {
|
|
@@ -27912,29 +27947,7 @@ function buildHtmlPlugin(config) {
|
|
|
27912
27947
|
href: toOutputPath(file)
|
|
27913
27948
|
}
|
|
27914
27949
|
});
|
|
27915
|
-
const
|
|
27916
|
-
if (seenChunks.has(chunk.fileName)) return [];
|
|
27917
|
-
seenChunks.add(chunk.fileName);
|
|
27918
|
-
if (analyzedImportedCssFiles.has(chunk)) {
|
|
27919
|
-
const additionals = analyzedImportedCssFiles.get(chunk).filter((file) => !seenCss.has(file));
|
|
27920
|
-
additionals.forEach((file) => seenCss.add(file));
|
|
27921
|
-
return additionals;
|
|
27922
|
-
}
|
|
27923
|
-
const files = [];
|
|
27924
|
-
chunk.imports.forEach((file) => {
|
|
27925
|
-
const importee = bundle[file];
|
|
27926
|
-
if (importee?.type === "chunk") files.push(...getCssFilesForChunk(importee, seenChunks, seenCss));
|
|
27927
|
-
});
|
|
27928
|
-
analyzedImportedCssFiles.set(chunk, files);
|
|
27929
|
-
chunk.viteMetadata.importedCss.forEach((file) => {
|
|
27930
|
-
if (!seenCss.has(file)) {
|
|
27931
|
-
seenCss.add(file);
|
|
27932
|
-
files.push(file);
|
|
27933
|
-
}
|
|
27934
|
-
});
|
|
27935
|
-
return files;
|
|
27936
|
-
};
|
|
27937
|
-
const getCssTagsForChunk = (chunk, toOutputPath) => getCssFilesForChunk(chunk).map((file) => toStyleSheetLinkTag(file, toOutputPath));
|
|
27950
|
+
const getCssTagsForChunk = (chunk, toOutputPath) => getCssFilesForChunk(chunk, bundle, analyzedImportedCssFiles).map((file) => toStyleSheetLinkTag(file, toOutputPath));
|
|
27938
27951
|
for (const [normalizedId, html] of processedHtml(this)) {
|
|
27939
27952
|
const relativeUrlPath = normalizePath$1(path.relative(config.root, normalizedId));
|
|
27940
27953
|
const assetsBase = getBaseInHTML(relativeUrlPath, config);
|
|
@@ -36190,13 +36203,20 @@ const svelteScriptModuleRE = /\bcontext\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s'">]+)
|
|
|
36190
36203
|
const svelteModuleRE = /\smodule\b/i;
|
|
36191
36204
|
function rolldownScanPlugin(environment, depImports, missing, entries) {
|
|
36192
36205
|
const seen = /* @__PURE__ */ new Map();
|
|
36193
|
-
async function resolveId(id, importer) {
|
|
36194
|
-
return environment.pluginContainer.resolveId(id, importer && normalizePath$1(importer), {
|
|
36206
|
+
async function resolveId(id, importer, options) {
|
|
36207
|
+
return environment.pluginContainer.resolveId(id, importer && normalizePath$1(importer), {
|
|
36208
|
+
scan: true,
|
|
36209
|
+
...options
|
|
36210
|
+
});
|
|
36195
36211
|
}
|
|
36196
|
-
const resolve = async (id, importer) => {
|
|
36197
|
-
const key =
|
|
36212
|
+
const resolve = async (id, importer, options) => {
|
|
36213
|
+
const key = JSON.stringify([
|
|
36214
|
+
id,
|
|
36215
|
+
importer && path.dirname(importer),
|
|
36216
|
+
options
|
|
36217
|
+
]);
|
|
36198
36218
|
if (seen.has(key)) return seen.get(key);
|
|
36199
|
-
const res = (await resolveId(id, importer))?.id;
|
|
36219
|
+
const res = (await resolveId(id, importer, options))?.id;
|
|
36200
36220
|
seen.set(key, res);
|
|
36201
36221
|
return res;
|
|
36202
36222
|
};
|
|
@@ -88,7 +88,7 @@ const isAbsolute = function(p) {
|
|
|
88
88
|
}, dirname = function(p) {
|
|
89
89
|
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
90
90
|
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
91
|
-
}, decodeBase64 = typeof
|
|
91
|
+
}, textDecoder = new TextDecoder(), decodeBase64 = typeof Buffer == "function" && typeof Buffer.from == "function" ? (base64) => Buffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0))), percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
|
|
92
92
|
function encodePathChars(filepath) {
|
|
93
93
|
return filepath.indexOf("%") !== -1 && (filepath = filepath.replace(percentRegEx, "%25")), !isWindows && filepath.indexOf("\\") !== -1 && (filepath = filepath.replace(backslashRegEx, "%5C")), filepath.indexOf("\n") !== -1 && (filepath = filepath.replace(newlineRegEx, "%0A")), filepath.indexOf("\r") !== -1 && (filepath = filepath.replace(carriageReturnRegEx, "%0D")), filepath.indexOf(" ") !== -1 && (filepath = filepath.replace(tabRegEx, "%09")), filepath;
|
|
94
94
|
}
|
|
@@ -749,10 +749,14 @@ function createHMRHandlerForRunner(runner) {
|
|
|
749
749
|
let { triggeredBy } = payload, clearEntrypointUrls = triggeredBy ? getModulesEntrypoints(runner, getModulesByFile(runner, slash(triggeredBy))) : findAllEntrypoints(runner);
|
|
750
750
|
if (!clearEntrypointUrls.size) break;
|
|
751
751
|
hmrClient.logger.debug("program reload"), await hmrClient.notifyListeners("vite:beforeFullReload", payload), runner.evaluatedModules.clear();
|
|
752
|
-
for (let url of clearEntrypointUrls)
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
752
|
+
for (let url of clearEntrypointUrls) {
|
|
753
|
+
if (runner.isClosed()) break;
|
|
754
|
+
try {
|
|
755
|
+
await runner.import(url);
|
|
756
|
+
} catch (err) {
|
|
757
|
+
if (runner.isClosed()) break;
|
|
758
|
+
err.code !== "ERR_OUTDATED_OPTIMIZED_DEP" && hmrClient.logger.error(`An error happened during full reload\n${err.message}\n${err.stack}`);
|
|
759
|
+
}
|
|
756
760
|
}
|
|
757
761
|
break;
|
|
758
762
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voidzero-dev/vite-plus-core",
|
|
3
|
-
"version": "0.1.15-alpha.
|
|
3
|
+
"version": "0.1.15-alpha.2",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"tree-kill": "^1.2.2",
|
|
130
130
|
"tsdown": "^0.21.5",
|
|
131
131
|
"rolldown": "1.0.0-rc.12",
|
|
132
|
-
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.15-alpha.
|
|
132
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.15-alpha.2"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"@arethetypeswrong/core": "^0.18.1",
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
"node": "^20.19.0 || >=22.12.0"
|
|
215
215
|
},
|
|
216
216
|
"bundledVersions": {
|
|
217
|
-
"vite": "8.0.
|
|
217
|
+
"vite": "8.0.3",
|
|
218
218
|
"rolldown": "1.0.0-rc.12",
|
|
219
219
|
"tsdown": "0.21.5"
|
|
220
220
|
},
|