@absolutejs/absolute 0.19.0-beta.690 → 0.19.0-beta.691
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/angular/index.js +46 -38
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +46 -38
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +163 -155
- package/dist/build.js.map +3 -3
- package/dist/index.js +190 -182
- package/dist/index.js.map +3 -3
- package/dist/islands/index.js +24 -16
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +24 -16
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +27 -19
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +24 -16
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +24 -16
- package/dist/vue/index.js.map +3 -3
- package/package.json +7 -7
package/dist/build.js
CHANGED
|
@@ -2450,8 +2450,9 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
2450
2450
|
// src/build/stylePreprocessor.ts
|
|
2451
2451
|
import { readFileSync as readFileSync3 } from "fs";
|
|
2452
2452
|
import { readFile } from "fs/promises";
|
|
2453
|
-
import {
|
|
2454
|
-
|
|
2453
|
+
import { createRequire } from "module";
|
|
2454
|
+
import { dirname as dirname3, extname as extname3, join as join5 } from "path";
|
|
2455
|
+
var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
2455
2456
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
2456
2457
|
if (normalized === "scss" || normalized.endsWith(".scss"))
|
|
2457
2458
|
return "scss";
|
|
@@ -2460,7 +2461,13 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
|
|
|
2460
2461
|
if (normalized === "less" || normalized.endsWith(".less"))
|
|
2461
2462
|
return "less";
|
|
2462
2463
|
return null;
|
|
2463
|
-
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`),
|
|
2464
|
+
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), requireOptionalPeerSync = (specifier) => {
|
|
2465
|
+
try {
|
|
2466
|
+
return requireFromCwd(specifier);
|
|
2467
|
+
} catch {
|
|
2468
|
+
return requireOptionalPeer(specifier);
|
|
2469
|
+
}
|
|
2470
|
+
}, compileStyleSource = async (filePath, source, languageHint) => {
|
|
2464
2471
|
const language = getStyleLanguage(languageHint ?? filePath);
|
|
2465
2472
|
const contents = source ?? await readFile(filePath, "utf-8");
|
|
2466
2473
|
if (language === "scss" || language === "sass") {
|
|
@@ -2521,7 +2528,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
|
|
|
2521
2528
|
if (language === "scss" || language === "sass") {
|
|
2522
2529
|
let sass;
|
|
2523
2530
|
try {
|
|
2524
|
-
sass =
|
|
2531
|
+
sass = requireOptionalPeerSync("sass");
|
|
2525
2532
|
} catch {
|
|
2526
2533
|
throw missingDependencyError("sass", filePath);
|
|
2527
2534
|
}
|
|
@@ -2543,6 +2550,7 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
2543
2550
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
|
|
2544
2551
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
2545
2552
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
2553
|
+
requireFromCwd = createRequire(join5(process.cwd(), "package.json"));
|
|
2546
2554
|
stylePreprocessorPlugin = {
|
|
2547
2555
|
name: "absolute-style-preprocessor",
|
|
2548
2556
|
setup(build) {
|
|
@@ -2581,13 +2589,13 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
2581
2589
|
|
|
2582
2590
|
// src/core/svelteServerModule.ts
|
|
2583
2591
|
import { mkdir, readdir as readdir2 } from "fs/promises";
|
|
2584
|
-
import { basename as basename2, dirname as dirname4, extname as extname4, join as
|
|
2592
|
+
import { basename as basename2, dirname as dirname4, extname as extname4, join as join6, relative as relative3, resolve as resolve6 } from "path";
|
|
2585
2593
|
var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
2586
2594
|
const importPath = relative3(dirname4(from), target).replace(/\\/g, "/");
|
|
2587
2595
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
2588
2596
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
2589
2597
|
for (const entry of entries) {
|
|
2590
|
-
const entryPath =
|
|
2598
|
+
const entryPath = join6(dir, entry.name);
|
|
2591
2599
|
if (entry.isDirectory())
|
|
2592
2600
|
stack.push(entryPath);
|
|
2593
2601
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -2617,11 +2625,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2617
2625
|
if (cachedPath !== undefined) {
|
|
2618
2626
|
return cachedPath;
|
|
2619
2627
|
}
|
|
2620
|
-
if (!sourcePath.includes(`${
|
|
2628
|
+
if (!sourcePath.includes(`${join6(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
2621
2629
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
2622
2630
|
return sourcePath;
|
|
2623
2631
|
}
|
|
2624
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
2632
|
+
const resolvedSourcePath = await findSourceFileByBasename(join6(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
2625
2633
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
2626
2634
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
2627
2635
|
return nextPath;
|
|
@@ -2637,11 +2645,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2637
2645
|
`${basePath}.mjs`,
|
|
2638
2646
|
`${basePath}.cjs`,
|
|
2639
2647
|
`${basePath}.json`,
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2648
|
+
join6(basePath, "index.ts"),
|
|
2649
|
+
join6(basePath, "index.js"),
|
|
2650
|
+
join6(basePath, "index.mjs"),
|
|
2651
|
+
join6(basePath, "index.cjs"),
|
|
2652
|
+
join6(basePath, "index.json")
|
|
2645
2653
|
];
|
|
2646
2654
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
2647
2655
|
const foundIndex = existResults.indexOf(true);
|
|
@@ -2649,7 +2657,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
2649
2657
|
}, getCachedModulePath = (sourcePath) => {
|
|
2650
2658
|
const relativeSourcePath = relative3(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
2651
2659
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
2652
|
-
return
|
|
2660
|
+
return join6(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
2653
2661
|
}, resolveSvelteImport = async (spec, from) => {
|
|
2654
2662
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
2655
2663
|
const resolved = resolvePackageImport(spec);
|
|
@@ -2750,7 +2758,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
2750
2758
|
init_lowerIslandSyntax();
|
|
2751
2759
|
init_lowerAwaitSlotSyntax();
|
|
2752
2760
|
init_stylePreprocessor();
|
|
2753
|
-
serverCacheRoot =
|
|
2761
|
+
serverCacheRoot = join6(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
2754
2762
|
compiledModuleCache = new Map;
|
|
2755
2763
|
originalSourcePathCache = new Map;
|
|
2756
2764
|
transpiler = new Bun.Transpiler({
|
|
@@ -3235,7 +3243,7 @@ var init_scanCssEntryPoints = __esm(() => {
|
|
|
3235
3243
|
|
|
3236
3244
|
// src/utils/imageProcessing.ts
|
|
3237
3245
|
import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "fs";
|
|
3238
|
-
import { join as
|
|
3246
|
+
import { join as join7, resolve as resolve7 } from "path";
|
|
3239
3247
|
var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
|
|
3240
3248
|
for (const size of sizes) {
|
|
3241
3249
|
if (size >= target)
|
|
@@ -3288,7 +3296,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
3288
3296
|
const image = config?.imageSizes ?? DEFAULT_IMAGE_SIZES;
|
|
3289
3297
|
return [...device, ...image].sort((left, right) => left - right);
|
|
3290
3298
|
}, getCacheDir = (buildDir) => {
|
|
3291
|
-
const dir =
|
|
3299
|
+
const dir = join7(buildDir, ".cache", "images");
|
|
3292
3300
|
if (!existsSync8(dir))
|
|
3293
3301
|
mkdirSync3(dir, { recursive: true });
|
|
3294
3302
|
return dir;
|
|
@@ -3345,8 +3353,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
3345
3353
|
return toBuffer(buffer);
|
|
3346
3354
|
}
|
|
3347
3355
|
}, readFromCache = (cacheDir, cacheKey) => {
|
|
3348
|
-
const metaPath =
|
|
3349
|
-
const dataPath =
|
|
3356
|
+
const metaPath = join7(cacheDir, `${cacheKey}.meta`);
|
|
3357
|
+
const dataPath = join7(cacheDir, `${cacheKey}.data`);
|
|
3350
3358
|
if (!existsSync8(metaPath) || !existsSync8(dataPath))
|
|
3351
3359
|
return null;
|
|
3352
3360
|
try {
|
|
@@ -3373,8 +3381,8 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
|
|
|
3373
3381
|
return null;
|
|
3374
3382
|
}
|
|
3375
3383
|
}, writeToCache = (cacheDir, cacheKey, buffer, meta) => {
|
|
3376
|
-
const metaPath =
|
|
3377
|
-
const dataPath =
|
|
3384
|
+
const metaPath = join7(cacheDir, `${cacheKey}.meta`);
|
|
3385
|
+
const dataPath = join7(cacheDir, `${cacheKey}.data`);
|
|
3378
3386
|
writeFileSync4(dataPath, buffer);
|
|
3379
3387
|
writeFileSync4(metaPath, JSON.stringify(meta));
|
|
3380
3388
|
};
|
|
@@ -3468,7 +3476,7 @@ var init_optimizeHtmlImages = __esm(() => {
|
|
|
3468
3476
|
// src/cli/scripts/telemetry.ts
|
|
3469
3477
|
import { existsSync as existsSync9, mkdirSync as mkdirSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync5 } from "fs";
|
|
3470
3478
|
import { homedir } from "os";
|
|
3471
|
-
import { join as
|
|
3479
|
+
import { join as join8 } from "path";
|
|
3472
3480
|
var configDir, configPath, getTelemetryConfig = () => {
|
|
3473
3481
|
try {
|
|
3474
3482
|
if (!existsSync9(configPath))
|
|
@@ -3481,14 +3489,14 @@ var configDir, configPath, getTelemetryConfig = () => {
|
|
|
3481
3489
|
}
|
|
3482
3490
|
};
|
|
3483
3491
|
var init_telemetry = __esm(() => {
|
|
3484
|
-
configDir =
|
|
3485
|
-
configPath =
|
|
3492
|
+
configDir = join8(homedir(), ".absolutejs");
|
|
3493
|
+
configPath = join8(configDir, "telemetry.json");
|
|
3486
3494
|
});
|
|
3487
3495
|
|
|
3488
3496
|
// src/cli/telemetryEvent.ts
|
|
3489
3497
|
import { existsSync as existsSync10, readFileSync as readFileSync7 } from "fs";
|
|
3490
3498
|
import { arch, platform } from "os";
|
|
3491
|
-
import { dirname as dirname5, join as
|
|
3499
|
+
import { dirname as dirname5, join as join9, parse } from "path";
|
|
3492
3500
|
var checkCandidate = (candidate) => {
|
|
3493
3501
|
if (!existsSync10(candidate)) {
|
|
3494
3502
|
return null;
|
|
@@ -3508,7 +3516,7 @@ var checkCandidate = (candidate) => {
|
|
|
3508
3516
|
}, findPackageVersion = () => {
|
|
3509
3517
|
let { dir } = import.meta;
|
|
3510
3518
|
while (dir !== parse(dir).root) {
|
|
3511
|
-
const candidate =
|
|
3519
|
+
const candidate = join9(dir, "package.json");
|
|
3512
3520
|
const version = checkCandidate(candidate);
|
|
3513
3521
|
if (version) {
|
|
3514
3522
|
return version;
|
|
@@ -3801,7 +3809,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
3801
3809
|
|
|
3802
3810
|
// src/build/angularLinkerPlugin.ts
|
|
3803
3811
|
import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync8, writeFileSync as writeFileSync6 } from "fs";
|
|
3804
|
-
import { dirname as dirname6, join as
|
|
3812
|
+
import { dirname as dirname6, join as join10, relative as relative4, resolve as resolve10 } from "path";
|
|
3805
3813
|
import { createHash } from "crypto";
|
|
3806
3814
|
var CACHE_DIR, angularLinkerPlugin;
|
|
3807
3815
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -3824,7 +3832,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
3824
3832
|
return;
|
|
3825
3833
|
}
|
|
3826
3834
|
const hash = createHash("md5").update(source).digest("hex");
|
|
3827
|
-
const cachePath =
|
|
3835
|
+
const cachePath = join10(CACHE_DIR, `${hash}.js`);
|
|
3828
3836
|
if (existsSync12(cachePath)) {
|
|
3829
3837
|
return {
|
|
3830
3838
|
contents: readFileSync8(cachePath, "utf-8"),
|
|
@@ -3901,7 +3909,7 @@ var init_cleanStaleOutputs = __esm(() => {
|
|
|
3901
3909
|
|
|
3902
3910
|
// src/utils/cleanup.ts
|
|
3903
3911
|
import { rm as rm3 } from "fs/promises";
|
|
3904
|
-
import { join as
|
|
3912
|
+
import { join as join11 } from "path";
|
|
3905
3913
|
var cleanup = async ({
|
|
3906
3914
|
angularDir,
|
|
3907
3915
|
reactDir,
|
|
@@ -3909,19 +3917,19 @@ var cleanup = async ({
|
|
|
3909
3917
|
vueDir
|
|
3910
3918
|
}) => {
|
|
3911
3919
|
await Promise.all([
|
|
3912
|
-
angularDir ? rm3(
|
|
3920
|
+
angularDir ? rm3(join11(angularDir, "generated"), {
|
|
3913
3921
|
force: true,
|
|
3914
3922
|
recursive: true
|
|
3915
3923
|
}) : undefined,
|
|
3916
|
-
reactDir ? rm3(
|
|
3924
|
+
reactDir ? rm3(join11(reactDir, "generated"), {
|
|
3917
3925
|
force: true,
|
|
3918
3926
|
recursive: true
|
|
3919
3927
|
}) : undefined,
|
|
3920
|
-
svelteDir ? rm3(
|
|
3928
|
+
svelteDir ? rm3(join11(svelteDir, "generated"), {
|
|
3921
3929
|
force: true,
|
|
3922
3930
|
recursive: true
|
|
3923
3931
|
}) : undefined,
|
|
3924
|
-
vueDir ? rm3(
|
|
3932
|
+
vueDir ? rm3(join11(vueDir, "generated"), {
|
|
3925
3933
|
force: true,
|
|
3926
3934
|
recursive: true
|
|
3927
3935
|
}) : undefined
|
|
@@ -4101,7 +4109,7 @@ import { existsSync as existsSync13 } from "fs";
|
|
|
4101
4109
|
import { mkdir as mkdir2, stat } from "fs/promises";
|
|
4102
4110
|
import {
|
|
4103
4111
|
dirname as dirname7,
|
|
4104
|
-
join as
|
|
4112
|
+
join as join12,
|
|
4105
4113
|
basename as basename4,
|
|
4106
4114
|
extname as extname5,
|
|
4107
4115
|
resolve as resolve13,
|
|
@@ -4160,14 +4168,14 @@ var resolveDevClientDir2 = () => {
|
|
|
4160
4168
|
`${basePath}.svelte`,
|
|
4161
4169
|
`${basePath}.svelte.ts`,
|
|
4162
4170
|
`${basePath}.svelte.js`,
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
+
join12(basePath, "index.ts"),
|
|
4172
|
+
join12(basePath, "index.js"),
|
|
4173
|
+
join12(basePath, "index.mjs"),
|
|
4174
|
+
join12(basePath, "index.cjs"),
|
|
4175
|
+
join12(basePath, "index.json"),
|
|
4176
|
+
join12(basePath, "index.svelte"),
|
|
4177
|
+
join12(basePath, "index.svelte.ts"),
|
|
4178
|
+
join12(basePath, "index.svelte.js")
|
|
4171
4179
|
];
|
|
4172
4180
|
const checks = await Promise.all(candidates.map(exists));
|
|
4173
4181
|
return candidates.find((_, index) => checks[index]) ?? null;
|
|
@@ -4205,10 +4213,10 @@ var resolveDevClientDir2 = () => {
|
|
|
4205
4213
|
});
|
|
4206
4214
|
}, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false) => {
|
|
4207
4215
|
const { compile, compileModule, preprocess } = await import("svelte/compiler");
|
|
4208
|
-
const generatedDir =
|
|
4209
|
-
const clientDir =
|
|
4210
|
-
const indexDir =
|
|
4211
|
-
const serverDir =
|
|
4216
|
+
const generatedDir = join12(svelteRoot, "generated");
|
|
4217
|
+
const clientDir = join12(generatedDir, "client");
|
|
4218
|
+
const indexDir = join12(generatedDir, "indexes");
|
|
4219
|
+
const serverDir = join12(generatedDir, "server");
|
|
4212
4220
|
await Promise.all([clientDir, indexDir, serverDir].map((dir) => mkdir2(dir, { recursive: true })));
|
|
4213
4221
|
const dev = env.NODE_ENV !== "production";
|
|
4214
4222
|
const build = async (src) => {
|
|
@@ -4246,8 +4254,8 @@ var resolveDevClientDir2 = () => {
|
|
|
4246
4254
|
const childBuilt = await Promise.all(childSources.map((child) => build(child)));
|
|
4247
4255
|
const hasAwaitSlotFromChildren = childBuilt.some((child) => child.hasAwaitSlot);
|
|
4248
4256
|
const externalRewrites = new Map;
|
|
4249
|
-
const ssrOutputDir = dirname7(
|
|
4250
|
-
const clientOutputDir = dirname7(
|
|
4257
|
+
const ssrOutputDir = dirname7(join12(serverDir, relDir, `${baseName}.js`));
|
|
4258
|
+
const clientOutputDir = dirname7(join12(clientDir, relDir, `${baseName}.js`));
|
|
4251
4259
|
for (let idx = 0;idx < importPaths.length; idx++) {
|
|
4252
4260
|
const rawSpec = importPaths[idx];
|
|
4253
4261
|
if (!rawSpec)
|
|
@@ -4313,8 +4321,8 @@ var resolveDevClientDir2 = () => {
|
|
|
4313
4321
|
code += islandMetadataExports;
|
|
4314
4322
|
return code;
|
|
4315
4323
|
};
|
|
4316
|
-
const ssrPath =
|
|
4317
|
-
const clientPath =
|
|
4324
|
+
const ssrPath = join12(serverDir, relDir, `${baseName}.js`);
|
|
4325
|
+
const clientPath = join12(clientDir, relDir, `${baseName}.js`);
|
|
4318
4326
|
await Promise.all([
|
|
4319
4327
|
mkdir2(dirname7(ssrPath), { recursive: true }),
|
|
4320
4328
|
mkdir2(dirname7(clientPath), { recursive: true })
|
|
@@ -4346,7 +4354,7 @@ var resolveDevClientDir2 = () => {
|
|
|
4346
4354
|
await Promise.all(roots.map(async ({ client, hasAwaitSlot }) => {
|
|
4347
4355
|
const relClientDir = dirname7(relative6(clientDir, client));
|
|
4348
4356
|
const name = basename4(client, extname5(client));
|
|
4349
|
-
const indexPath =
|
|
4357
|
+
const indexPath = join12(indexDir, relClientDir, `${name}.js`);
|
|
4350
4358
|
const importRaw = relative6(dirname7(indexPath), client).split(sep2).join("/");
|
|
4351
4359
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
4352
4360
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
@@ -4425,7 +4433,7 @@ if (typeof window !== "undefined") {
|
|
|
4425
4433
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
4426
4434
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
4427
4435
|
const rel = dirname7(relative6(clientDir, client));
|
|
4428
|
-
return
|
|
4436
|
+
return join12(indexDir, rel, basename4(client));
|
|
4429
4437
|
}),
|
|
4430
4438
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
4431
4439
|
};
|
|
@@ -4439,7 +4447,7 @@ var init_compileSvelte = __esm(() => {
|
|
|
4439
4447
|
init_lowerAwaitSlotSyntax();
|
|
4440
4448
|
init_renderToReadableStream();
|
|
4441
4449
|
devClientDir2 = resolveDevClientDir2();
|
|
4442
|
-
hmrClientPath3 =
|
|
4450
|
+
hmrClientPath3 = join12(devClientDir2, "hmrClient.ts").replace(/\\/g, "/");
|
|
4443
4451
|
persistentCache = new Map;
|
|
4444
4452
|
sourceHashCache = new Map;
|
|
4445
4453
|
transpiler2 = new Transpiler({ loader: "ts", target: "browser" });
|
|
@@ -4456,7 +4464,7 @@ __export(exports_compileVue, {
|
|
|
4456
4464
|
});
|
|
4457
4465
|
import { existsSync as existsSync14 } from "fs";
|
|
4458
4466
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
4459
|
-
import { basename as basename5, dirname as dirname8, join as
|
|
4467
|
+
import { basename as basename5, dirname as dirname8, join as join13, relative as relative7, resolve as resolve14 } from "path";
|
|
4460
4468
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
4461
4469
|
var resolveDevClientDir3 = () => {
|
|
4462
4470
|
const projectRoot = process.cwd();
|
|
@@ -4612,7 +4620,7 @@ var resolveDevClientDir3 = () => {
|
|
|
4612
4620
|
];
|
|
4613
4621
|
let cssOutputPaths = [];
|
|
4614
4622
|
if (isEntryPoint && allCss.length) {
|
|
4615
|
-
const cssOutputFile =
|
|
4623
|
+
const cssOutputFile = join13(outputDirs.css, `${toKebab(fileBaseName)}-compiled.css`);
|
|
4616
4624
|
await mkdir3(dirname8(cssOutputFile), { recursive: true });
|
|
4617
4625
|
await write2(cssOutputFile, allCss.join(`
|
|
4618
4626
|
`));
|
|
@@ -4643,8 +4651,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
4643
4651
|
};
|
|
4644
4652
|
const clientCode = assembleModule(generateRenderFunction(false), "render", true) + islandMetadataExports;
|
|
4645
4653
|
const serverCode = assembleModule(generateRenderFunction(true), "ssrRender", false) + islandMetadataExports;
|
|
4646
|
-
const clientOutputPath =
|
|
4647
|
-
const serverOutputPath =
|
|
4654
|
+
const clientOutputPath = join13(outputDirs.client, `${relativeWithoutExtension}.js`);
|
|
4655
|
+
const serverOutputPath = join13(outputDirs.server, `${relativeWithoutExtension}.js`);
|
|
4648
4656
|
const relDir = dirname8(relativeFilePath);
|
|
4649
4657
|
const relDepth = relDir === "." ? 0 : relDir.split("/").length;
|
|
4650
4658
|
const adjustImports = (code) => code.replace(/(from\s+['"])(\.\.\/(?:\.\.\/)*)/g, (_, prefix, dots) => {
|
|
@@ -4684,11 +4692,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
4684
4692
|
return result;
|
|
4685
4693
|
}, compileVue = async (entryPoints, vueRootDir, isDev = false) => {
|
|
4686
4694
|
const compiler = await import("@vue/compiler-sfc");
|
|
4687
|
-
const generatedDir =
|
|
4688
|
-
const clientOutputDir =
|
|
4689
|
-
const indexOutputDir =
|
|
4690
|
-
const serverOutputDir =
|
|
4691
|
-
const cssOutputDir =
|
|
4695
|
+
const generatedDir = join13(vueRootDir, "generated");
|
|
4696
|
+
const clientOutputDir = join13(generatedDir, "client");
|
|
4697
|
+
const indexOutputDir = join13(generatedDir, "indexes");
|
|
4698
|
+
const serverOutputDir = join13(generatedDir, "server");
|
|
4699
|
+
const cssOutputDir = join13(generatedDir, "compiled");
|
|
4692
4700
|
await Promise.all([
|
|
4693
4701
|
mkdir3(clientOutputDir, { recursive: true }),
|
|
4694
4702
|
mkdir3(indexOutputDir, { recursive: true }),
|
|
@@ -4705,8 +4713,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
4705
4713
|
}, buildCache, true, vueRootDir, compiler);
|
|
4706
4714
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
4707
4715
|
const entryBaseName = basename5(entryPath, ".vue");
|
|
4708
|
-
const indexOutputFile =
|
|
4709
|
-
const clientOutputFile =
|
|
4716
|
+
const indexOutputFile = join13(indexOutputDir, `${entryBaseName}.js`);
|
|
4717
|
+
const clientOutputFile = join13(clientOutputDir, relative7(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
4710
4718
|
await mkdir3(dirname8(indexOutputFile), { recursive: true });
|
|
4711
4719
|
const vueHmrImports = isDev ? [
|
|
4712
4720
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -4835,8 +4843,8 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
4835
4843
|
const sourceCode = await file2(tsPath).text();
|
|
4836
4844
|
const transpiledCode = transpiler3.transformSync(sourceCode);
|
|
4837
4845
|
const relativeJsPath = relative7(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
4838
|
-
const outClientPath =
|
|
4839
|
-
const outServerPath =
|
|
4846
|
+
const outClientPath = join13(clientOutputDir, relativeJsPath);
|
|
4847
|
+
const outServerPath = join13(serverOutputDir, relativeJsPath);
|
|
4840
4848
|
await mkdir3(dirname8(outClientPath), { recursive: true });
|
|
4841
4849
|
await mkdir3(dirname8(outServerPath), { recursive: true });
|
|
4842
4850
|
await write2(outClientPath, transpiledCode);
|
|
@@ -4856,7 +4864,7 @@ var init_compileVue = __esm(() => {
|
|
|
4856
4864
|
init_sourceMetadata();
|
|
4857
4865
|
init_stylePreprocessor();
|
|
4858
4866
|
devClientDir3 = resolveDevClientDir3();
|
|
4859
|
-
hmrClientPath4 =
|
|
4867
|
+
hmrClientPath4 = join13(devClientDir3, "hmrClient.ts").replace(/\\/g, "/");
|
|
4860
4868
|
transpiler3 = new Transpiler2({ loader: "ts", target: "browser" });
|
|
4861
4869
|
scriptCache = new Map;
|
|
4862
4870
|
scriptSetupCache = new Map;
|
|
@@ -5336,7 +5344,7 @@ __export(exports_compileAngular, {
|
|
|
5336
5344
|
compileAngular: () => compileAngular
|
|
5337
5345
|
});
|
|
5338
5346
|
import { existsSync as existsSync15, readFileSync as readFileSync9, promises as fs } from "fs";
|
|
5339
|
-
import { join as
|
|
5347
|
+
import { join as join14, basename as basename6, sep as sep3, dirname as dirname9, resolve as resolve15, relative as relative8 } from "path";
|
|
5340
5348
|
import ts2 from "typescript";
|
|
5341
5349
|
import { createHash as createHash2 } from "crypto";
|
|
5342
5350
|
var computeConfigHash = () => {
|
|
@@ -5447,7 +5455,7 @@ ${registrations}
|
|
|
5447
5455
|
const originalGetSourceFile = host.getSourceFile;
|
|
5448
5456
|
host.getSourceFile = (fileName, languageVersion, onError) => {
|
|
5449
5457
|
if (fileName.startsWith("lib.") && fileName.endsWith(".d.ts") && tsLibDir) {
|
|
5450
|
-
const resolvedPath =
|
|
5458
|
+
const resolvedPath = join14(tsLibDir, fileName);
|
|
5451
5459
|
return originalGetSourceFile?.call(host, resolvedPath, languageVersion, onError);
|
|
5452
5460
|
}
|
|
5453
5461
|
return originalGetSourceFile?.call(host, fileName, languageVersion, onError);
|
|
@@ -5505,7 +5513,7 @@ ${registrations}
|
|
|
5505
5513
|
}
|
|
5506
5514
|
throwOnCompilationErrors(diagnostics);
|
|
5507
5515
|
const entries = Object.entries(emitted).filter(([fileName]) => fileName.endsWith(".js")).map(([fileName, content]) => {
|
|
5508
|
-
const target =
|
|
5516
|
+
const target = join14(outDir, fileName);
|
|
5509
5517
|
let processedContent = content.replace(/from\s+(['"])(\.\.?\/[^'"]+)(\1)/g, (match, quote, path) => {
|
|
5510
5518
|
if (!path.match(/\.(js|ts|mjs|cjs)$/)) {
|
|
5511
5519
|
return `from ${quote}${path}.js${quote}`;
|
|
@@ -5661,7 +5669,7 @@ ${fields}
|
|
|
5661
5669
|
}, inlineTemplateAndLowerDefer = async (source, fileDir) => {
|
|
5662
5670
|
const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5663
5671
|
if (templateUrlMatch?.[1]) {
|
|
5664
|
-
const templatePath =
|
|
5672
|
+
const templatePath = join14(fileDir, templateUrlMatch[1]);
|
|
5665
5673
|
if (!existsSync15(templatePath)) {
|
|
5666
5674
|
return { deferSlots: [], source };
|
|
5667
5675
|
}
|
|
@@ -5692,7 +5700,7 @@ ${fields}
|
|
|
5692
5700
|
}, inlineTemplateAndLowerDeferSync = (source, fileDir) => {
|
|
5693
5701
|
const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5694
5702
|
if (templateUrlMatch?.[1]) {
|
|
5695
|
-
const templatePath =
|
|
5703
|
+
const templatePath = join14(fileDir, templateUrlMatch[1]);
|
|
5696
5704
|
if (!existsSync15(templatePath)) {
|
|
5697
5705
|
return { deferSlots: [], source };
|
|
5698
5706
|
}
|
|
@@ -5734,7 +5742,7 @@ ${fields}
|
|
|
5734
5742
|
return source;
|
|
5735
5743
|
const inlinedStyles = urlMatches.map((urlMatch) => {
|
|
5736
5744
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
5737
|
-
return readAndEscapeFileSync(
|
|
5745
|
+
return readAndEscapeFileSync(join14(fileDir, styleUrl));
|
|
5738
5746
|
}).filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
5739
5747
|
if (inlinedStyles.length === 0)
|
|
5740
5748
|
return source;
|
|
@@ -5743,7 +5751,7 @@ ${fields}
|
|
|
5743
5751
|
const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5744
5752
|
if (!styleUrlMatch?.[1])
|
|
5745
5753
|
return source;
|
|
5746
|
-
const escaped = readAndEscapeFileSync(
|
|
5754
|
+
const escaped = readAndEscapeFileSync(join14(fileDir, styleUrlMatch[1]));
|
|
5747
5755
|
if (!escaped)
|
|
5748
5756
|
return source;
|
|
5749
5757
|
return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
|
|
@@ -5765,7 +5773,7 @@ ${fields}
|
|
|
5765
5773
|
return source;
|
|
5766
5774
|
const stylePromises = urlMatches.map((urlMatch) => {
|
|
5767
5775
|
const styleUrl = urlMatch.replace(/['"]/g, "");
|
|
5768
|
-
return readAndEscapeFile(
|
|
5776
|
+
return readAndEscapeFile(join14(fileDir, styleUrl));
|
|
5769
5777
|
});
|
|
5770
5778
|
const results = await Promise.all(stylePromises);
|
|
5771
5779
|
const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
|
|
@@ -5776,7 +5784,7 @@ ${fields}
|
|
|
5776
5784
|
const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
|
|
5777
5785
|
if (!styleUrlMatch?.[1])
|
|
5778
5786
|
return source;
|
|
5779
|
-
const escaped = await readAndEscapeFile(
|
|
5787
|
+
const escaped = await readAndEscapeFile(join14(fileDir, styleUrlMatch[1]));
|
|
5780
5788
|
if (!escaped)
|
|
5781
5789
|
return source;
|
|
5782
5790
|
return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
|
|
@@ -5851,8 +5859,8 @@ ${fields}
|
|
|
5851
5859
|
const inputDir = dirname9(actualPath);
|
|
5852
5860
|
const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
|
|
5853
5861
|
const fileBase = basename6(actualPath).replace(/\.ts$/, ".js");
|
|
5854
|
-
const targetDir =
|
|
5855
|
-
const targetPath =
|
|
5862
|
+
const targetDir = join14(outDir, relativeDir);
|
|
5863
|
+
const targetPath = join14(targetDir, fileBase);
|
|
5856
5864
|
const localImports = [];
|
|
5857
5865
|
const fromRegex = /(?:from|import)\s+['"](\.\.?\/[^'"]+)['"]/g;
|
|
5858
5866
|
const dynamicImportRegex = /import\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g;
|
|
@@ -5885,13 +5893,13 @@ ${fields}
|
|
|
5885
5893
|
await transpileFile(inputPath);
|
|
5886
5894
|
return allOutputs;
|
|
5887
5895
|
}, compileAngular = async (entryPoints, outRoot, hmr = false) => {
|
|
5888
|
-
const compiledParent =
|
|
5896
|
+
const compiledParent = join14(outRoot, "generated");
|
|
5889
5897
|
if (entryPoints.length === 0) {
|
|
5890
5898
|
const emptyPaths = [];
|
|
5891
5899
|
return { clientPaths: [...emptyPaths], serverPaths: [...emptyPaths] };
|
|
5892
5900
|
}
|
|
5893
5901
|
const compiledRoot = compiledParent;
|
|
5894
|
-
const indexesDir =
|
|
5902
|
+
const indexesDir = join14(compiledParent, "indexes");
|
|
5895
5903
|
await fs.mkdir(indexesDir, { recursive: true });
|
|
5896
5904
|
const compileTasks = entryPoints.map(async (entry) => {
|
|
5897
5905
|
const resolvedEntry = resolve15(entry);
|
|
@@ -5901,9 +5909,9 @@ ${fields}
|
|
|
5901
5909
|
const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
|
|
5902
5910
|
const jsName = `${fileBase}.js`;
|
|
5903
5911
|
const compiledFallbackPaths = [
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5912
|
+
join14(compiledRoot, relativeEntry),
|
|
5913
|
+
join14(compiledRoot, "pages", jsName),
|
|
5914
|
+
join14(compiledRoot, jsName)
|
|
5907
5915
|
].map((file3) => resolve15(file3));
|
|
5908
5916
|
const resolveRawServerFile = (candidatePaths) => {
|
|
5909
5917
|
const normalizedCandidates = [
|
|
@@ -5937,7 +5945,7 @@ ${fields}
|
|
|
5937
5945
|
const componentClassName = `${toPascal(fileBase)}Component`;
|
|
5938
5946
|
const serverContentHash = Bun.hash(original).toString(BASE_36_RADIX);
|
|
5939
5947
|
const cachedWrapper = wrapperOutputCache.get(resolvedEntry);
|
|
5940
|
-
const clientFile =
|
|
5948
|
+
const clientFile = join14(indexesDir, jsName);
|
|
5941
5949
|
if (hmr && cachedWrapper && cachedWrapper.serverHash === serverContentHash && existsSync15(clientFile)) {
|
|
5942
5950
|
return {
|
|
5943
5951
|
clientPath: clientFile,
|
|
@@ -6125,8 +6133,8 @@ var init_compileAngular = __esm(() => {
|
|
|
6125
6133
|
init_lowerDeferSyntax();
|
|
6126
6134
|
init_stylePreprocessor();
|
|
6127
6135
|
devClientDir4 = resolveDevClientDir4();
|
|
6128
|
-
hmrClientPath5 =
|
|
6129
|
-
hmrRuntimePath =
|
|
6136
|
+
hmrClientPath5 = join14(devClientDir4, "hmrClient.ts").replace(/\\/g, "/");
|
|
6137
|
+
hmrRuntimePath = join14(devClientDir4, "handlers", "angularRuntime.ts").replace(/\\/g, "/");
|
|
6130
6138
|
jitContentCache = new Map;
|
|
6131
6139
|
wrapperOutputCache = new Map;
|
|
6132
6140
|
});
|
|
@@ -6138,7 +6146,7 @@ __export(exports_buildReactVendor, {
|
|
|
6138
6146
|
buildReactVendor: () => buildReactVendor
|
|
6139
6147
|
});
|
|
6140
6148
|
import { existsSync as existsSync16, mkdirSync as mkdirSync6 } from "fs";
|
|
6141
|
-
import { join as
|
|
6149
|
+
import { join as join15, resolve as resolve16 } from "path";
|
|
6142
6150
|
import { rm as rm4 } from "fs/promises";
|
|
6143
6151
|
var {build: bunBuild2 } = globalThis.Bun;
|
|
6144
6152
|
var resolveJsxDevRuntimeCompatPath = () => {
|
|
@@ -6192,14 +6200,14 @@ var resolveJsxDevRuntimeCompatPath = () => {
|
|
|
6192
6200
|
`)}
|
|
6193
6201
|
`;
|
|
6194
6202
|
}, buildReactVendor = async (buildDir) => {
|
|
6195
|
-
const vendorDir =
|
|
6203
|
+
const vendorDir = join15(buildDir, "react", "vendor");
|
|
6196
6204
|
mkdirSync6(vendorDir, { recursive: true });
|
|
6197
|
-
const tmpDir =
|
|
6205
|
+
const tmpDir = join15(buildDir, "_vendor_tmp");
|
|
6198
6206
|
mkdirSync6(tmpDir, { recursive: true });
|
|
6199
6207
|
const specifiers = resolveVendorSpecifiers();
|
|
6200
6208
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
6201
6209
|
const safeName = toSafeFileName(specifier);
|
|
6202
|
-
const entryPath =
|
|
6210
|
+
const entryPath = join15(tmpDir, `${safeName}.ts`);
|
|
6203
6211
|
const source = await generateEntrySource(specifier);
|
|
6204
6212
|
await Bun.write(entryPath, source);
|
|
6205
6213
|
return entryPath;
|
|
@@ -6237,17 +6245,17 @@ __export(exports_buildAngularVendor, {
|
|
|
6237
6245
|
buildAngularVendor: () => buildAngularVendor
|
|
6238
6246
|
});
|
|
6239
6247
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
6240
|
-
import { join as
|
|
6248
|
+
import { join as join16 } from "path";
|
|
6241
6249
|
import { rm as rm5 } from "fs/promises";
|
|
6242
6250
|
var {build: bunBuild3 } = globalThis.Bun;
|
|
6243
6251
|
var angularSpecifiers, toSafeFileName2 = (specifier) => specifier.replace(/^@/, "").replace(/\//g, "_"), buildAngularVendor = async (buildDir) => {
|
|
6244
|
-
const vendorDir =
|
|
6252
|
+
const vendorDir = join16(buildDir, "angular", "vendor");
|
|
6245
6253
|
mkdirSync7(vendorDir, { recursive: true });
|
|
6246
|
-
const tmpDir =
|
|
6254
|
+
const tmpDir = join16(buildDir, "_angular_vendor_tmp");
|
|
6247
6255
|
mkdirSync7(tmpDir, { recursive: true });
|
|
6248
6256
|
const entrypoints = await Promise.all(angularSpecifiers.map(async (specifier) => {
|
|
6249
6257
|
const safeName = toSafeFileName2(specifier);
|
|
6250
|
-
const entryPath =
|
|
6258
|
+
const entryPath = join16(tmpDir, `${safeName}.ts`);
|
|
6251
6259
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
6252
6260
|
`);
|
|
6253
6261
|
return entryPath;
|
|
@@ -6292,17 +6300,17 @@ __export(exports_buildVueVendor, {
|
|
|
6292
6300
|
buildVueVendor: () => buildVueVendor
|
|
6293
6301
|
});
|
|
6294
6302
|
import { mkdirSync as mkdirSync8 } from "fs";
|
|
6295
|
-
import { join as
|
|
6303
|
+
import { join as join17 } from "path";
|
|
6296
6304
|
import { rm as rm6 } from "fs/promises";
|
|
6297
6305
|
var {build: bunBuild4 } = globalThis.Bun;
|
|
6298
6306
|
var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"), buildVueVendor = async (buildDir) => {
|
|
6299
|
-
const vendorDir =
|
|
6307
|
+
const vendorDir = join17(buildDir, "vue", "vendor");
|
|
6300
6308
|
mkdirSync8(vendorDir, { recursive: true });
|
|
6301
|
-
const tmpDir =
|
|
6309
|
+
const tmpDir = join17(buildDir, "_vue_vendor_tmp");
|
|
6302
6310
|
mkdirSync8(tmpDir, { recursive: true });
|
|
6303
6311
|
const entrypoints = await Promise.all(vueSpecifiers.map(async (specifier) => {
|
|
6304
6312
|
const safeName = toSafeFileName3(specifier);
|
|
6305
|
-
const entryPath =
|
|
6313
|
+
const entryPath = join17(tmpDir, `${safeName}.ts`);
|
|
6306
6314
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
6307
6315
|
`);
|
|
6308
6316
|
return entryPath;
|
|
@@ -6330,7 +6338,7 @@ var vueSpecifiers, toSafeFileName3 = (specifier) => specifier.replace(/\//g, "_"
|
|
|
6330
6338
|
const { readFileSync: readFileSync10, writeFileSync: writeFileSync7, readdirSync } = await import("fs");
|
|
6331
6339
|
const files = readdirSync(vendorDir).filter((f) => f.endsWith(".js"));
|
|
6332
6340
|
for (const file3 of files) {
|
|
6333
|
-
const filePath =
|
|
6341
|
+
const filePath = join17(vendorDir, file3);
|
|
6334
6342
|
const content = readFileSync10(filePath, "utf-8");
|
|
6335
6343
|
if (!content.includes("__VUE_HMR_RUNTIME__"))
|
|
6336
6344
|
continue;
|
|
@@ -6357,7 +6365,7 @@ __export(exports_buildSvelteVendor, {
|
|
|
6357
6365
|
buildSvelteVendor: () => buildSvelteVendor
|
|
6358
6366
|
});
|
|
6359
6367
|
import { mkdirSync as mkdirSync9 } from "fs";
|
|
6360
|
-
import { join as
|
|
6368
|
+
import { join as join18 } from "path";
|
|
6361
6369
|
import { rm as rm7 } from "fs/promises";
|
|
6362
6370
|
var {build: bunBuild5 } = globalThis.Bun;
|
|
6363
6371
|
var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
@@ -6371,13 +6379,13 @@ var svelteSpecifiers, isResolvable2 = (specifier) => {
|
|
|
6371
6379
|
const specifiers = resolveVendorSpecifiers2();
|
|
6372
6380
|
if (specifiers.length === 0)
|
|
6373
6381
|
return;
|
|
6374
|
-
const vendorDir =
|
|
6382
|
+
const vendorDir = join18(buildDir, "svelte", "vendor");
|
|
6375
6383
|
mkdirSync9(vendorDir, { recursive: true });
|
|
6376
|
-
const tmpDir =
|
|
6384
|
+
const tmpDir = join18(buildDir, "_svelte_vendor_tmp");
|
|
6377
6385
|
mkdirSync9(tmpDir, { recursive: true });
|
|
6378
6386
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
6379
6387
|
const safeName = toSafeFileName4(specifier);
|
|
6380
|
-
const entryPath =
|
|
6388
|
+
const entryPath = join18(tmpDir, `${safeName}.ts`);
|
|
6381
6389
|
await Bun.write(entryPath, `export * from '${specifier}';
|
|
6382
6390
|
`);
|
|
6383
6391
|
return entryPath;
|
|
@@ -6461,7 +6469,7 @@ import {
|
|
|
6461
6469
|
statSync,
|
|
6462
6470
|
writeFileSync as writeFileSync7
|
|
6463
6471
|
} from "fs";
|
|
6464
|
-
import { basename as basename7, dirname as dirname10, join as
|
|
6472
|
+
import { basename as basename7, dirname as dirname10, join as join19, relative as relative9, resolve as resolve17 } from "path";
|
|
6465
6473
|
import { cwd, env as env2, exit } from "process";
|
|
6466
6474
|
var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
|
|
6467
6475
|
var isDev, collectConventionSourceFiles = (entry) => {
|
|
@@ -6536,8 +6544,8 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
6536
6544
|
mkdirSync10(htmxDestDir, { recursive: true });
|
|
6537
6545
|
const glob = new Glob6("htmx*.min.js");
|
|
6538
6546
|
for (const relPath of glob.scanSync({ cwd: htmxDir })) {
|
|
6539
|
-
const src =
|
|
6540
|
-
const dest =
|
|
6547
|
+
const src = join19(htmxDir, relPath);
|
|
6548
|
+
const dest = join19(htmxDestDir, "htmx.min.js");
|
|
6541
6549
|
copyFileSync(src, dest);
|
|
6542
6550
|
return;
|
|
6543
6551
|
}
|
|
@@ -6610,7 +6618,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
6610
6618
|
vuePagesPath
|
|
6611
6619
|
}) => {
|
|
6612
6620
|
const { readdirSync: readDir } = await import("fs");
|
|
6613
|
-
const devIndexDir =
|
|
6621
|
+
const devIndexDir = join19(buildPath, "_src_indexes");
|
|
6614
6622
|
mkdirSync10(devIndexDir, { recursive: true });
|
|
6615
6623
|
if (reactIndexesPath && reactPagesPath) {
|
|
6616
6624
|
copyReactDevIndexes(reactIndexesPath, reactPagesPath, devIndexDir, readDir);
|
|
@@ -6628,35 +6636,35 @@ var isDev, collectConventionSourceFiles = (entry) => {
|
|
|
6628
6636
|
const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
|
|
6629
6637
|
const pagesRel = relative9(process.cwd(), resolve17(reactPagesPath)).replace(/\\/g, "/");
|
|
6630
6638
|
for (const file3 of indexFiles) {
|
|
6631
|
-
let content = readFileSync10(
|
|
6639
|
+
let content = readFileSync10(join19(reactIndexesPath, file3), "utf-8");
|
|
6632
6640
|
content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
|
|
6633
|
-
writeFileSync7(
|
|
6641
|
+
writeFileSync7(join19(devIndexDir, file3), content);
|
|
6634
6642
|
}
|
|
6635
6643
|
}, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
|
|
6636
|
-
const svelteIndexDir =
|
|
6644
|
+
const svelteIndexDir = join19(svelteDir, "generated", "indexes");
|
|
6637
6645
|
const sveltePageEntries = svelteEntries.filter((file3) => resolve17(file3).startsWith(resolve17(sveltePagesPath)));
|
|
6638
6646
|
for (const entry of sveltePageEntries) {
|
|
6639
6647
|
const name = basename7(entry).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
6640
|
-
const indexFile =
|
|
6648
|
+
const indexFile = join19(svelteIndexDir, "pages", `${name}.js`);
|
|
6641
6649
|
if (!existsSync17(indexFile))
|
|
6642
6650
|
continue;
|
|
6643
6651
|
let content = readFileSync10(indexFile, "utf-8");
|
|
6644
6652
|
const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
|
|
6645
6653
|
content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
|
|
6646
|
-
writeFileSync7(
|
|
6654
|
+
writeFileSync7(join19(devIndexDir, `${name}.svelte.js`), content);
|
|
6647
6655
|
}
|
|
6648
6656
|
}, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
|
|
6649
|
-
const vueIndexDir =
|
|
6657
|
+
const vueIndexDir = join19(vueDir, "generated", "indexes");
|
|
6650
6658
|
const vuePageEntries = vueEntries.filter((file3) => resolve17(file3).startsWith(resolve17(vuePagesPath)));
|
|
6651
6659
|
for (const entry of vuePageEntries) {
|
|
6652
6660
|
const name = basename7(entry, ".vue");
|
|
6653
|
-
const indexFile =
|
|
6661
|
+
const indexFile = join19(vueIndexDir, `${name}.js`);
|
|
6654
6662
|
if (!existsSync17(indexFile))
|
|
6655
6663
|
continue;
|
|
6656
6664
|
let content = readFileSync10(indexFile, "utf-8");
|
|
6657
6665
|
const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
|
|
6658
6666
|
content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
|
|
6659
|
-
writeFileSync7(
|
|
6667
|
+
writeFileSync7(join19(devIndexDir, `${name}.vue.js`), content);
|
|
6660
6668
|
}
|
|
6661
6669
|
}, resolveVueRuntimeId = (content, firstUseName, outputPath, projectRoot) => {
|
|
6662
6670
|
const varIdx = content.indexOf(`var ${firstUseName} =`);
|
|
@@ -6804,14 +6812,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6804
6812
|
const stylesPath = typeof stylesConfig === "string" ? stylesConfig : stylesConfig?.path;
|
|
6805
6813
|
const stylesIgnore = typeof stylesConfig === "object" ? stylesConfig.ignore : undefined;
|
|
6806
6814
|
const stylesDir = stylesPath && validateSafePath(stylesPath, projectRoot);
|
|
6807
|
-
const reactIndexesPath = reactDir &&
|
|
6808
|
-
const reactPagesPath = reactDir &&
|
|
6809
|
-
const htmlPagesPath = htmlDir &&
|
|
6810
|
-
const htmlScriptsPath = htmlDir &&
|
|
6811
|
-
const sveltePagesPath = svelteDir &&
|
|
6812
|
-
const vuePagesPath = vueDir &&
|
|
6813
|
-
const htmxPagesPath = htmxDir &&
|
|
6814
|
-
const angularPagesPath = angularDir &&
|
|
6815
|
+
const reactIndexesPath = reactDir && join19(reactDir, "generated", "indexes");
|
|
6816
|
+
const reactPagesPath = reactDir && join19(reactDir, "pages");
|
|
6817
|
+
const htmlPagesPath = htmlDir && join19(htmlDir, "pages");
|
|
6818
|
+
const htmlScriptsPath = htmlDir && join19(htmlDir, "scripts");
|
|
6819
|
+
const sveltePagesPath = svelteDir && join19(svelteDir, "pages");
|
|
6820
|
+
const vuePagesPath = vueDir && join19(vueDir, "pages");
|
|
6821
|
+
const htmxPagesPath = htmxDir && join19(htmxDir, "pages");
|
|
6822
|
+
const angularPagesPath = angularDir && join19(angularDir, "pages");
|
|
6815
6823
|
const frontends = [
|
|
6816
6824
|
reactDir,
|
|
6817
6825
|
htmlDir,
|
|
@@ -6848,12 +6856,12 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6848
6856
|
if (svelteDir)
|
|
6849
6857
|
serverDirMap.push({
|
|
6850
6858
|
dir: svelteDir,
|
|
6851
|
-
subdir:
|
|
6859
|
+
subdir: join19("generated", "server")
|
|
6852
6860
|
});
|
|
6853
6861
|
if (vueDir)
|
|
6854
6862
|
serverDirMap.push({
|
|
6855
6863
|
dir: vueDir,
|
|
6856
|
-
subdir:
|
|
6864
|
+
subdir: join19("generated", "server")
|
|
6857
6865
|
});
|
|
6858
6866
|
if (angularDir)
|
|
6859
6867
|
serverDirMap.push({ dir: angularDir, subdir: "generated" });
|
|
@@ -6863,8 +6871,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6863
6871
|
const [firstEntry] = serverDirMap;
|
|
6864
6872
|
if (!firstEntry)
|
|
6865
6873
|
throw new Error("Expected at least one server directory entry");
|
|
6866
|
-
serverRoot =
|
|
6867
|
-
serverOutDir =
|
|
6874
|
+
serverRoot = join19(firstEntry.dir, firstEntry.subdir);
|
|
6875
|
+
serverOutDir = join19(buildPath, basename7(firstEntry.dir));
|
|
6868
6876
|
} else if (serverDirMap.length > 1) {
|
|
6869
6877
|
serverRoot = commonAncestor(serverDirMap.map((entry) => entry.dir), projectRoot);
|
|
6870
6878
|
serverOutDir = buildPath;
|
|
@@ -6892,7 +6900,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6892
6900
|
await generateReactIndexFiles(reactPagesPath, reactIndexesPath, hmr);
|
|
6893
6901
|
}
|
|
6894
6902
|
if (assetsPath && (!isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/assets/")))) {
|
|
6895
|
-
cpSync(assetsPath,
|
|
6903
|
+
cpSync(assetsPath, join19(buildPath, "assets"), {
|
|
6896
6904
|
force: true,
|
|
6897
6905
|
recursive: true
|
|
6898
6906
|
});
|
|
@@ -6906,7 +6914,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6906
6914
|
} catch {
|
|
6907
6915
|
binPath = "tailwindcss";
|
|
6908
6916
|
}
|
|
6909
|
-
const proc = Bun.spawn(["bun", binPath, "-i", input, "-o",
|
|
6917
|
+
const proc = Bun.spawn(["bun", binPath, "-i", input, "-o", join19(buildPath, output)], { stderr: "pipe", stdout: "pipe" });
|
|
6910
6918
|
await proc.exited;
|
|
6911
6919
|
};
|
|
6912
6920
|
const tailwindPromise = tailwind && (!isIncremental || normalizedIncrementalFiles?.some(isStylePath)) ? compileTailwind(tailwind.input, tailwind.output) : undefined;
|
|
@@ -6953,7 +6961,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
6953
6961
|
const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
|
|
6954
6962
|
if (entry.startsWith(resolve17(reactIndexesPath))) {
|
|
6955
6963
|
const pageName = basename7(entry, ".tsx");
|
|
6956
|
-
return
|
|
6964
|
+
return join19(reactPagesPath, `${pageName}.tsx`);
|
|
6957
6965
|
}
|
|
6958
6966
|
return null;
|
|
6959
6967
|
}) : allReactEntries;
|
|
@@ -7040,11 +7048,11 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7040
7048
|
vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false)) : { vueServerPaths: emptyStringArray }
|
|
7041
7049
|
]);
|
|
7042
7050
|
const copyConventionFiles = (framework, sources, compiledPaths) => {
|
|
7043
|
-
const destDir =
|
|
7051
|
+
const destDir = join19(buildPath, "conventions", framework);
|
|
7044
7052
|
mkdirSync10(destDir, { recursive: true });
|
|
7045
7053
|
const destPaths = [];
|
|
7046
7054
|
for (const compiledPath of compiledPaths) {
|
|
7047
|
-
const dest =
|
|
7055
|
+
const dest = join19(destDir, basename7(compiledPath));
|
|
7048
7056
|
copyFileSync(compiledPath, dest);
|
|
7049
7057
|
destPaths.push(dest);
|
|
7050
7058
|
}
|
|
@@ -7090,7 +7098,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7090
7098
|
}
|
|
7091
7099
|
}) : {
|
|
7092
7100
|
entries: [],
|
|
7093
|
-
generatedRoot:
|
|
7101
|
+
generatedRoot: join19(buildPath, "_island_entries")
|
|
7094
7102
|
};
|
|
7095
7103
|
const islandClientEntryPoints = islandEntryResult.entries.map((entry) => entry.entryPath);
|
|
7096
7104
|
if (serverEntryPoints.length === 0 && reactClientEntryPoints.length === 0 && nonReactClientEntryPoints.length === 0 && islandClientEntryPoints.length === 0 && htmxDir === undefined && htmlDir === undefined) {
|
|
@@ -7125,7 +7133,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7125
7133
|
return {};
|
|
7126
7134
|
}
|
|
7127
7135
|
if (hmr && reactIndexesPath && reactClientEntryPoints.length > 0) {
|
|
7128
|
-
const refreshEntry =
|
|
7136
|
+
const refreshEntry = join19(reactIndexesPath, "_refresh.tsx");
|
|
7129
7137
|
if (!reactClientEntryPoints.includes(refreshEntry))
|
|
7130
7138
|
reactClientEntryPoints.push(refreshEntry);
|
|
7131
7139
|
}
|
|
@@ -7180,19 +7188,19 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7180
7188
|
throw: false
|
|
7181
7189
|
} : undefined;
|
|
7182
7190
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
7183
|
-
rmSync2(
|
|
7191
|
+
rmSync2(join19(buildPath, "react", "generated", "indexes"), {
|
|
7184
7192
|
force: true,
|
|
7185
7193
|
recursive: true
|
|
7186
7194
|
});
|
|
7187
7195
|
}
|
|
7188
7196
|
if (angularDir && angularClientPaths.length > 0) {
|
|
7189
|
-
rmSync2(
|
|
7197
|
+
rmSync2(join19(buildPath, "angular", "indexes"), {
|
|
7190
7198
|
force: true,
|
|
7191
7199
|
recursive: true
|
|
7192
7200
|
});
|
|
7193
7201
|
}
|
|
7194
7202
|
if (islandClientEntryPoints.length > 0) {
|
|
7195
|
-
rmSync2(
|
|
7203
|
+
rmSync2(join19(buildPath, "islands"), {
|
|
7196
7204
|
force: true,
|
|
7197
7205
|
recursive: true
|
|
7198
7206
|
});
|
|
@@ -7278,7 +7286,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7278
7286
|
globalCssEntries.length > 0 ? bunBuild6({
|
|
7279
7287
|
entrypoints: globalCssEntries,
|
|
7280
7288
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
7281
|
-
outdir: stylesDir ?
|
|
7289
|
+
outdir: stylesDir ? join19(buildPath, basename7(stylesDir)) : buildPath,
|
|
7282
7290
|
root: stylesDir || clientRoot,
|
|
7283
7291
|
target: "browser",
|
|
7284
7292
|
plugins: [stylePreprocessorPlugin],
|
|
@@ -7287,7 +7295,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7287
7295
|
vueCssPaths.length > 0 ? bunBuild6({
|
|
7288
7296
|
entrypoints: vueCssPaths,
|
|
7289
7297
|
naming: `[name].[hash].[ext]`,
|
|
7290
|
-
outdir:
|
|
7298
|
+
outdir: join19(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
|
|
7291
7299
|
target: "browser",
|
|
7292
7300
|
throw: false
|
|
7293
7301
|
}) : undefined
|
|
@@ -7420,7 +7428,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7420
7428
|
const processHtmlPages = async () => {
|
|
7421
7429
|
if (!(htmlDir && htmlPagesPath))
|
|
7422
7430
|
return;
|
|
7423
|
-
const outputHtmlPages = isSingle ?
|
|
7431
|
+
const outputHtmlPages = isSingle ? join19(buildPath, "pages") : join19(buildPath, basename7(htmlDir), "pages");
|
|
7424
7432
|
mkdirSync10(outputHtmlPages, { recursive: true });
|
|
7425
7433
|
cpSync(htmlPagesPath, outputHtmlPages, {
|
|
7426
7434
|
force: true,
|
|
@@ -7442,14 +7450,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7442
7450
|
const processHtmxPages = async () => {
|
|
7443
7451
|
if (!(htmxDir && htmxPagesPath))
|
|
7444
7452
|
return;
|
|
7445
|
-
const outputHtmxPages = isSingle ?
|
|
7453
|
+
const outputHtmxPages = isSingle ? join19(buildPath, "pages") : join19(buildPath, basename7(htmxDir), "pages");
|
|
7446
7454
|
mkdirSync10(outputHtmxPages, { recursive: true });
|
|
7447
7455
|
cpSync(htmxPagesPath, outputHtmxPages, {
|
|
7448
7456
|
force: true,
|
|
7449
7457
|
recursive: true
|
|
7450
7458
|
});
|
|
7451
7459
|
if (shouldCopyHtmx) {
|
|
7452
|
-
const htmxDestDir = isSingle ? buildPath :
|
|
7460
|
+
const htmxDestDir = isSingle ? buildPath : join19(buildPath, basename7(htmxDir));
|
|
7453
7461
|
copyHtmxVendor(htmxDir, htmxDestDir);
|
|
7454
7462
|
}
|
|
7455
7463
|
if (shouldUpdateHtmxAssetPaths) {
|
|
@@ -7504,9 +7512,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
7504
7512
|
});
|
|
7505
7513
|
if (isIncremental)
|
|
7506
7514
|
return { conventions: conventionsMap, manifest };
|
|
7507
|
-
writeFileSync7(
|
|
7515
|
+
writeFileSync7(join19(buildPath, "manifest.json"), JSON.stringify(manifest, null, "\t"));
|
|
7508
7516
|
if (Object.keys(conventionsMap).length > 0) {
|
|
7509
|
-
writeFileSync7(
|
|
7517
|
+
writeFileSync7(join19(buildPath, "conventions.json"), JSON.stringify(conventionsMap, null, "\t"));
|
|
7510
7518
|
}
|
|
7511
7519
|
return { conventions: conventionsMap, manifest };
|
|
7512
7520
|
};
|
|
@@ -8028,7 +8036,7 @@ var init_pathUtils = __esm(() => {
|
|
|
8028
8036
|
// src/dev/fileWatcher.ts
|
|
8029
8037
|
import { watch } from "fs";
|
|
8030
8038
|
import { existsSync as existsSync19 } from "fs";
|
|
8031
|
-
import { join as
|
|
8039
|
+
import { join as join20, resolve as resolve20 } from "path";
|
|
8032
8040
|
var safeRemoveFromGraph = (graph, fullPath) => {
|
|
8033
8041
|
try {
|
|
8034
8042
|
removeFileFromGraph(graph, fullPath);
|
|
@@ -8055,7 +8063,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
|
|
|
8055
8063
|
if (shouldSkipFilename(filename, isStylesDir)) {
|
|
8056
8064
|
return;
|
|
8057
8065
|
}
|
|
8058
|
-
const fullPath =
|
|
8066
|
+
const fullPath = join20(absolutePath, filename).replace(/\\/g, "/");
|
|
8059
8067
|
if (shouldIgnorePath(fullPath, state.resolvedPaths)) {
|
|
8060
8068
|
return;
|
|
8061
8069
|
}
|
|
@@ -9299,15 +9307,15 @@ var init_streamingSlotWarningScope = __esm(() => {
|
|
|
9299
9307
|
import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
|
|
9300
9308
|
import { mkdir as mkdir4, symlink } from "fs/promises";
|
|
9301
9309
|
import { tmpdir } from "os";
|
|
9302
|
-
import { basename as basename10, dirname as dirname12, join as
|
|
9310
|
+
import { basename as basename10, dirname as dirname12, join as join21, resolve as resolve25 } from "path";
|
|
9303
9311
|
var ssrDirty = false, lastSelector = "angular-page", isRecord7 = (value) => typeof value === "object" && value !== null, isAngularComponent = (value) => typeof value === "function", compilerImportPromise = null, ensureAngularCompiler = () => {
|
|
9304
9312
|
if (!compilerImportPromise) {
|
|
9305
9313
|
compilerImportPromise = import("@angular/compiler");
|
|
9306
9314
|
}
|
|
9307
9315
|
return compilerImportPromise;
|
|
9308
|
-
}, readAngularPageModule = (value) => isRecord7(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ??
|
|
9316
|
+
}, readAngularPageModule = (value) => isRecord7(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join21(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
|
|
9309
9317
|
const outRoot = resolve25(dirname12(dirname12(outDir)));
|
|
9310
|
-
const nodeModulesLink =
|
|
9318
|
+
const nodeModulesLink = join21(outRoot, "node_modules");
|
|
9311
9319
|
if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
|
|
9312
9320
|
return;
|
|
9313
9321
|
}
|
|
@@ -12160,7 +12168,7 @@ __export(exports_buildDepVendor, {
|
|
|
12160
12168
|
buildDepVendor: () => buildDepVendor
|
|
12161
12169
|
});
|
|
12162
12170
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
12163
|
-
import { join as
|
|
12171
|
+
import { join as join22 } from "path";
|
|
12164
12172
|
import { rm as rm8 } from "fs/promises";
|
|
12165
12173
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
12166
12174
|
var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable3 = (specifier) => {
|
|
@@ -12210,7 +12218,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
12210
12218
|
}, content);
|
|
12211
12219
|
const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
12212
12220
|
for (const file3 of files) {
|
|
12213
|
-
const filePath =
|
|
12221
|
+
const filePath = join22(vendorDir, file3);
|
|
12214
12222
|
const original = readFileSync15(filePath, "utf-8");
|
|
12215
12223
|
const rewritten = rewriteContent(original);
|
|
12216
12224
|
if (rewritten !== original)
|
|
@@ -12220,13 +12228,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
12220
12228
|
const specifiers = await scanBareImports(directories);
|
|
12221
12229
|
if (specifiers.length === 0)
|
|
12222
12230
|
return {};
|
|
12223
|
-
const vendorDir =
|
|
12231
|
+
const vendorDir = join22(buildDir, "vendor");
|
|
12224
12232
|
mkdirSync11(vendorDir, { recursive: true });
|
|
12225
|
-
const tmpDir =
|
|
12233
|
+
const tmpDir = join22(buildDir, "_dep_vendor_tmp");
|
|
12226
12234
|
mkdirSync11(tmpDir, { recursive: true });
|
|
12227
12235
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
12228
12236
|
const safeName = toSafeFileName5(specifier);
|
|
12229
|
-
const entryPath =
|
|
12237
|
+
const entryPath = join22(tmpDir, `${safeName}.ts`);
|
|
12230
12238
|
const source = await generateEntrySource2(specifier);
|
|
12231
12239
|
await Bun.write(entryPath, source);
|
|
12232
12240
|
return entryPath;
|
|
@@ -12610,5 +12618,5 @@ export {
|
|
|
12610
12618
|
build
|
|
12611
12619
|
};
|
|
12612
12620
|
|
|
12613
|
-
//# debugId=
|
|
12621
|
+
//# debugId=C1C8D716AF311CB564756E2164756E21
|
|
12614
12622
|
//# sourceMappingURL=build.js.map
|