@absolutejs/absolute 0.19.0-beta.107 → 0.19.0-beta.109
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/.absolutejs/tsconfig.tsbuildinfo +1 -1
- package/dist/build.js +57 -51
- package/dist/build.js.map +3 -3
- package/dist/index.js +60 -54
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/build.js
CHANGED
|
@@ -123,7 +123,7 @@ __export(exports_generateReactIndexes, {
|
|
|
123
123
|
});
|
|
124
124
|
import { existsSync, mkdirSync } from "fs";
|
|
125
125
|
import { readdir, rm, writeFile } from "fs/promises";
|
|
126
|
-
import { basename, join, resolve } from "path";
|
|
126
|
+
import { basename, join, relative, resolve } from "path";
|
|
127
127
|
var {Glob } = globalThis.Bun;
|
|
128
128
|
var indexContentCache, resolveDevClientDir = () => {
|
|
129
129
|
const fromSource = resolve(import.meta.dir, "../dev/client");
|
|
@@ -412,7 +412,13 @@ var indexContentCache, resolveDevClientDir = () => {
|
|
|
412
412
|
` originalError.apply(console, args);`,
|
|
413
413
|
` };`,
|
|
414
414
|
` }`,
|
|
415
|
-
`}
|
|
415
|
+
`}`,
|
|
416
|
+
...isDev ? [
|
|
417
|
+
`
|
|
418
|
+
// Pre-warm: import the page module from the module server`,
|
|
419
|
+
`// immediately so the browser caches all /@src/ URLs.`,
|
|
420
|
+
`import('/@src/${relative(process.cwd(), resolve(reactPagesDirectory, componentName + ".tsx")).replace(/\\/g, "/")}').catch(() => {});`
|
|
421
|
+
] : []
|
|
416
422
|
].join(`
|
|
417
423
|
`);
|
|
418
424
|
const indexPath = join(reactIndexesDirectory, `${componentName}.tsx`);
|
|
@@ -866,7 +872,7 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
|
|
|
866
872
|
|
|
867
873
|
// src/build/angularLinkerPlugin.ts
|
|
868
874
|
import { existsSync as existsSync7, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
869
|
-
import { dirname as dirname2, join as join4, relative, resolve as resolve4 } from "path";
|
|
875
|
+
import { dirname as dirname2, join as join4, relative as relative2, resolve as resolve4 } from "path";
|
|
870
876
|
import { createHash } from "crypto";
|
|
871
877
|
var CACHE_DIR, angularLinkerPlugin;
|
|
872
878
|
var init_angularLinkerPlugin = __esm(() => {
|
|
@@ -909,7 +915,7 @@ var init_angularLinkerPlugin = __esm(() => {
|
|
|
909
915
|
dirname: dirname2,
|
|
910
916
|
exists: existsSync7,
|
|
911
917
|
readFile: readFileSync3,
|
|
912
|
-
relative,
|
|
918
|
+
relative: relative2,
|
|
913
919
|
resolve: resolve4
|
|
914
920
|
},
|
|
915
921
|
linkerJitMode: false,
|
|
@@ -950,11 +956,11 @@ var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPath
|
|
|
950
956
|
const currentPaths = new Set(currentOutputPaths.map((path) => resolve5(path)));
|
|
951
957
|
const glob = new Glob4("**/*");
|
|
952
958
|
const removals = [];
|
|
953
|
-
for (const
|
|
954
|
-
const absolute = resolve5(buildPath,
|
|
959
|
+
for (const relative3 of glob.scanSync({ cwd: buildPath })) {
|
|
960
|
+
const absolute = resolve5(buildPath, relative3);
|
|
955
961
|
if (currentPaths.has(absolute))
|
|
956
962
|
continue;
|
|
957
|
-
if (!HASHED_FILE_PATTERN.test(
|
|
963
|
+
if (!HASHED_FILE_PATTERN.test(relative3))
|
|
958
964
|
continue;
|
|
959
965
|
removals.push(rm2(absolute, { force: true }));
|
|
960
966
|
}
|
|
@@ -1108,12 +1114,12 @@ var init_startupBanner = __esm(() => {
|
|
|
1108
1114
|
// src/utils/logger.ts
|
|
1109
1115
|
var colors2, frameworkColors, formatPath = (filePath) => {
|
|
1110
1116
|
const cwd = process.cwd();
|
|
1111
|
-
let
|
|
1112
|
-
|
|
1113
|
-
if (!
|
|
1114
|
-
|
|
1117
|
+
let relative3 = filePath.startsWith(cwd) ? filePath.slice(cwd.length + 1) : filePath;
|
|
1118
|
+
relative3 = relative3.replace(/\\/g, "/");
|
|
1119
|
+
if (!relative3.startsWith("/")) {
|
|
1120
|
+
relative3 = `/${relative3}`;
|
|
1115
1121
|
}
|
|
1116
|
-
return
|
|
1122
|
+
return relative3;
|
|
1117
1123
|
}, getFrameworkColor = (framework) => frameworkColors[framework] || colors2.white, log = (action, options) => {
|
|
1118
1124
|
const timestamp = `${colors2.dim}${formatTimestamp()}${colors2.reset}`;
|
|
1119
1125
|
const tag = `${colors2.cyan}[hmr]${colors2.reset}`;
|
|
@@ -1172,11 +1178,11 @@ var init_logger = __esm(() => {
|
|
|
1172
1178
|
});
|
|
1173
1179
|
|
|
1174
1180
|
// src/utils/validateSafePath.ts
|
|
1175
|
-
import { resolve as resolve6, relative as
|
|
1181
|
+
import { resolve as resolve6, relative as relative3 } from "path";
|
|
1176
1182
|
var validateSafePath = (targetPath, baseDirectory) => {
|
|
1177
1183
|
const absoluteBase = resolve6(baseDirectory);
|
|
1178
1184
|
const absoluteTarget = resolve6(baseDirectory, targetPath);
|
|
1179
|
-
const relativePath = normalizePath(
|
|
1185
|
+
const relativePath = normalizePath(relative3(absoluteBase, absoluteTarget));
|
|
1180
1186
|
if (relativePath.startsWith("../") || relativePath === "..") {
|
|
1181
1187
|
throw new Error(`Unsafe path: ${targetPath}`);
|
|
1182
1188
|
}
|
|
@@ -1198,7 +1204,7 @@ import {
|
|
|
1198
1204
|
basename as basename2,
|
|
1199
1205
|
extname as extname2,
|
|
1200
1206
|
resolve as resolve7,
|
|
1201
|
-
relative as
|
|
1207
|
+
relative as relative4,
|
|
1202
1208
|
sep
|
|
1203
1209
|
} from "path";
|
|
1204
1210
|
import { env } from "process";
|
|
@@ -1262,7 +1268,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1262
1268
|
const isModule = src.endsWith(".svelte.ts") || src.endsWith(".svelte.js");
|
|
1263
1269
|
const preprocessed = isModule ? raw : (await preprocess(raw, {})).code;
|
|
1264
1270
|
const transpiled = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler.transformSync(preprocessed) : preprocessed;
|
|
1265
|
-
const relDir = dirname3(
|
|
1271
|
+
const relDir = dirname3(relative4(svelteRoot, src)).replace(/\\/g, "/");
|
|
1266
1272
|
const baseName = basename2(src).replace(/\.svelte(\.(ts|js))?$/, "");
|
|
1267
1273
|
const importPaths = Array.from(transpiled.matchAll(/from\s+['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((path) => path !== undefined);
|
|
1268
1274
|
const resolvedImports = await Promise.all(importPaths.map((importPath) => resolveSvelte(importPath, src)));
|
|
@@ -1281,7 +1287,7 @@ var resolveDevClientDir2 = () => {
|
|
|
1281
1287
|
}).js.code;
|
|
1282
1288
|
let code = raw2.replace(/\.svelte(?:\.(?:ts|js))?(['"])/g, ".js$1");
|
|
1283
1289
|
if (mode === "client" && isDev) {
|
|
1284
|
-
const moduleKey = `/@src/${
|
|
1290
|
+
const moduleKey = `/@src/${relative4(process.cwd(), src).replace(/\\/g, "/")}`;
|
|
1285
1291
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
1286
1292
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
1287
1293
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleKey)}] = cb; };`);
|
|
@@ -1316,10 +1322,10 @@ var resolveDevClientDir2 = () => {
|
|
|
1316
1322
|
};
|
|
1317
1323
|
const roots = await Promise.all(entryPoints.map(build));
|
|
1318
1324
|
await Promise.all(roots.map(async ({ client }) => {
|
|
1319
|
-
const relClientDir = dirname3(
|
|
1325
|
+
const relClientDir = dirname3(relative4(clientDir, client));
|
|
1320
1326
|
const name = basename2(client, extname2(client));
|
|
1321
1327
|
const indexPath = join6(indexDir, relClientDir, `${name}.js`);
|
|
1322
|
-
const importRaw =
|
|
1328
|
+
const importRaw = relative4(dirname3(indexPath), client).split(sep).join("/");
|
|
1323
1329
|
const importPath = importRaw.startsWith(".") || importRaw.startsWith("/") ? importRaw : `./${importRaw}`;
|
|
1324
1330
|
const hmrImports = isDev ? `window.__HMR_FRAMEWORK__ = "svelte";
|
|
1325
1331
|
import "${hmrClientPath3}";
|
|
@@ -1359,7 +1365,7 @@ if (typeof window !== "undefined") {
|
|
|
1359
1365
|
return {
|
|
1360
1366
|
svelteClientPaths: roots.map(({ client }) => client),
|
|
1361
1367
|
svelteIndexPaths: roots.map(({ client }) => {
|
|
1362
|
-
const rel = dirname3(
|
|
1368
|
+
const rel = dirname3(relative4(clientDir, client));
|
|
1363
1369
|
return join6(indexDir, rel, basename2(client));
|
|
1364
1370
|
}),
|
|
1365
1371
|
svelteServerPaths: roots.map(({ ssr }) => ssr)
|
|
@@ -1384,7 +1390,7 @@ __export(exports_compileVue, {
|
|
|
1384
1390
|
});
|
|
1385
1391
|
import { existsSync as existsSync9 } from "fs";
|
|
1386
1392
|
import { mkdir as mkdir2 } from "fs/promises";
|
|
1387
|
-
import { basename as basename3, dirname as dirname4, join as join7, relative as
|
|
1393
|
+
import { basename as basename3, dirname as dirname4, join as join7, relative as relative5, resolve as resolve8 } from "path";
|
|
1388
1394
|
var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
|
|
1389
1395
|
var resolveDevClientDir3 = () => {
|
|
1390
1396
|
const fromSource = resolve8(import.meta.dir, "../dev/client");
|
|
@@ -1429,7 +1435,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1429
1435
|
return "template-only";
|
|
1430
1436
|
}
|
|
1431
1437
|
return "full";
|
|
1432
|
-
}, generateVueHmrId = (sourceFilePath, vueRootDir) =>
|
|
1438
|
+
}, generateVueHmrId = (sourceFilePath, vueRootDir) => relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/").replace(/\.vue$/, ""), extractImports = (sourceCode) => Array.from(sourceCode.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((importPath) => importPath !== undefined), toJs = (filePath) => {
|
|
1433
1439
|
if (filePath.endsWith(".vue"))
|
|
1434
1440
|
return filePath.replace(/\.vue$/, ".js");
|
|
1435
1441
|
if (filePath.endsWith(".ts"))
|
|
@@ -1456,7 +1462,7 @@ var resolveDevClientDir3 = () => {
|
|
|
1456
1462
|
const cachedResult = cacheMap.get(sourceFilePath);
|
|
1457
1463
|
if (cachedResult)
|
|
1458
1464
|
return cachedResult;
|
|
1459
|
-
const relativeFilePath =
|
|
1465
|
+
const relativeFilePath = relative5(vueRootDir, sourceFilePath).replace(/\\/g, "/");
|
|
1460
1466
|
const relativeWithoutExtension = relativeFilePath.replace(/\.vue$/, "");
|
|
1461
1467
|
const fileBaseName = basename3(sourceFilePath, ".vue");
|
|
1462
1468
|
const componentId = toKebab(fileBaseName);
|
|
@@ -1585,7 +1591,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1585
1591
|
result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
|
|
1586
1592
|
const entryBaseName = basename3(entryPath, ".vue");
|
|
1587
1593
|
const indexOutputFile = join7(indexOutputDir, `${entryBaseName}.js`);
|
|
1588
|
-
const clientOutputFile = join7(clientOutputDir,
|
|
1594
|
+
const clientOutputFile = join7(clientOutputDir, relative5(vueRootDir, entryPath).replace(/\\/g, "/").replace(/\.vue$/, ".js"));
|
|
1589
1595
|
await mkdir2(dirname4(indexOutputFile), { recursive: true });
|
|
1590
1596
|
const vueHmrImports = isDev ? [
|
|
1591
1597
|
`window.__HMR_FRAMEWORK__ = "vue";`,
|
|
@@ -1593,7 +1599,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1593
1599
|
] : [];
|
|
1594
1600
|
await write2(indexOutputFile, [
|
|
1595
1601
|
...vueHmrImports,
|
|
1596
|
-
`import Comp from "${
|
|
1602
|
+
`import Comp from "${relative5(dirname4(indexOutputFile), clientOutputFile).replace(/\\/g, "/")}";`,
|
|
1597
1603
|
'import { createSSRApp, createApp } from "vue";',
|
|
1598
1604
|
"",
|
|
1599
1605
|
"// HMR State Preservation: Check for preserved state from HMR",
|
|
@@ -1693,7 +1699,7 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
|
|
|
1693
1699
|
await Promise.all(Array.from(allTsHelperPaths).map(async (tsPath) => {
|
|
1694
1700
|
const sourceCode = await file2(tsPath).text();
|
|
1695
1701
|
const transpiledCode = transpiler2.transformSync(sourceCode);
|
|
1696
|
-
const relativeJsPath =
|
|
1702
|
+
const relativeJsPath = relative5(vueRootDir, tsPath).replace(/\.ts$/, ".js");
|
|
1697
1703
|
const outClientPath = join7(clientOutputDir, relativeJsPath);
|
|
1698
1704
|
const outServerPath = join7(serverOutputDir, relativeJsPath);
|
|
1699
1705
|
await mkdir2(dirname4(outClientPath), { recursive: true });
|
|
@@ -10583,11 +10589,11 @@ ${lanes.join(`
|
|
|
10583
10589
|
return toComponents;
|
|
10584
10590
|
}
|
|
10585
10591
|
const components = toComponents.slice(start);
|
|
10586
|
-
const
|
|
10592
|
+
const relative6 = [];
|
|
10587
10593
|
for (;start < fromComponents.length; start++) {
|
|
10588
|
-
|
|
10594
|
+
relative6.push("..");
|
|
10589
10595
|
}
|
|
10590
|
-
return ["", ...
|
|
10596
|
+
return ["", ...relative6, ...components];
|
|
10591
10597
|
}
|
|
10592
10598
|
function getRelativePathFromDirectory(fromDirectory, to, getCanonicalFileNameOrIgnoreCase) {
|
|
10593
10599
|
Debug.assert(getRootLength(fromDirectory) > 0 === getRootLength(to) > 0, "Paths must either both be absolute or both be relative");
|
|
@@ -47883,9 +47889,9 @@ ${lanes.join(`
|
|
|
47883
47889
|
if (!startsWithDirectory(target, realPathDirectory, getCanonicalFileName)) {
|
|
47884
47890
|
return;
|
|
47885
47891
|
}
|
|
47886
|
-
const
|
|
47892
|
+
const relative6 = getRelativePathFromDirectory(realPathDirectory, target, getCanonicalFileName);
|
|
47887
47893
|
for (const symlinkDirectory of symlinkDirectories) {
|
|
47888
|
-
const option = resolvePath(symlinkDirectory,
|
|
47894
|
+
const option = resolvePath(symlinkDirectory, relative6);
|
|
47889
47895
|
const result2 = cb(option, target === referenceRedirect);
|
|
47890
47896
|
shouldFilterIgnoredPaths = true;
|
|
47891
47897
|
if (result2)
|
|
@@ -170451,7 +170457,7 @@ __export(exports_compileAngular, {
|
|
|
170451
170457
|
compileAngular: () => compileAngular
|
|
170452
170458
|
});
|
|
170453
170459
|
import { existsSync as existsSync10, readFileSync as readFileSync4, promises as fs } from "fs";
|
|
170454
|
-
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as
|
|
170460
|
+
import { join as join8, basename as basename4, sep as sep2, dirname as dirname5, resolve as resolve9, relative as relative6 } from "path";
|
|
170455
170461
|
import { createHash as createHash2 } from "crypto";
|
|
170456
170462
|
var import_typescript, computeConfigHash = () => {
|
|
170457
170463
|
try {
|
|
@@ -170760,7 +170766,7 @@ export default ${componentClassName};
|
|
|
170760
170766
|
await fs.writeFile(ssrDepsFile, ssrDepsContent, "utf-8");
|
|
170761
170767
|
}
|
|
170762
170768
|
await fs.writeFile(rawServerFile, rewritten, "utf-8");
|
|
170763
|
-
const relativePath =
|
|
170769
|
+
const relativePath = relative6(indexesDir, rawServerFile).replace(/\\/g, "/");
|
|
170764
170770
|
const normalizedImportPath = relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
170765
170771
|
const hmrPreamble = hmr ? `window.__HMR_FRAMEWORK__ = "angular";
|
|
170766
170772
|
import "${hmrRuntimePath}";
|
|
@@ -171139,7 +171145,7 @@ import {
|
|
|
171139
171145
|
rmSync,
|
|
171140
171146
|
writeFileSync as writeFileSync3
|
|
171141
171147
|
} from "fs";
|
|
171142
|
-
import { basename as basename5, join as join13, relative as
|
|
171148
|
+
import { basename as basename5, join as join13, relative as relative7, resolve as resolve10 } from "path";
|
|
171143
171149
|
import { cwd, env as env2, exit } from "process";
|
|
171144
171150
|
var {build: bunBuild6, Glob: Glob5 } = globalThis.Bun;
|
|
171145
171151
|
var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental, throwOnError) => {
|
|
@@ -171704,7 +171710,7 @@ var isDev, extractBuildError = (logs, pass, label, frameworkNames, isIncremental
|
|
|
171704
171710
|
const devIndexDir = join13(buildPath, "_src_indexes");
|
|
171705
171711
|
mkdirSync8(devIndexDir, { recursive: true });
|
|
171706
171712
|
const indexFiles = readDir(reactIndexesPath).filter((f) => f.endsWith(".tsx"));
|
|
171707
|
-
const pagesRel =
|
|
171713
|
+
const pagesRel = relative7(process.cwd(), resolve10(reactPagesPath)).replace(/\\/g, "/");
|
|
171708
171714
|
for (const file3 of indexFiles) {
|
|
171709
171715
|
let content = readFileSync5(join13(reactIndexesPath, file3), "utf-8");
|
|
171710
171716
|
content = content.replace(/from\s*['"]\.\.\/pages\/([^'"]+)['"]/g, `from '/@src/${pagesRel}/$1'`);
|
|
@@ -202393,7 +202399,7 @@ __export(exports_moduleServer, {
|
|
|
202393
202399
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
202394
202400
|
});
|
|
202395
202401
|
import { existsSync as existsSync13, readFileSync as readFileSync9, statSync } from "fs";
|
|
202396
|
-
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, relative as
|
|
202402
|
+
import { basename as basename7, dirname as dirname7, extname as extname3, resolve as resolve17, relative as relative8 } from "path";
|
|
202397
202403
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
202398
202404
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
202399
202405
|
const allExports = [];
|
|
@@ -202456,7 +202462,7 @@ ${stubs}
|
|
|
202456
202462
|
const fileDir = dirname7(filePath);
|
|
202457
202463
|
result = result.replace(/(from\s*["'])(\.\.?\/[^"']+)(["'])/g, (_match, prefix, relPath, suffix) => {
|
|
202458
202464
|
const absPath = resolve17(fileDir, relPath);
|
|
202459
|
-
const rel =
|
|
202465
|
+
const rel = relative8(projectRoot, absPath);
|
|
202460
202466
|
let srcPath = rel;
|
|
202461
202467
|
if (!extname3(srcPath)) {
|
|
202462
202468
|
const extensions = [
|
|
@@ -202477,19 +202483,19 @@ ${stubs}
|
|
|
202477
202483
|
}
|
|
202478
202484
|
if (extname3(srcPath) === ".svelte") {
|
|
202479
202485
|
const resolved = resolveSvelteModulePath(resolve17(projectRoot, srcPath));
|
|
202480
|
-
const resolvedRel =
|
|
202486
|
+
const resolvedRel = relative8(projectRoot, resolved);
|
|
202481
202487
|
srcPath = resolvedRel;
|
|
202482
202488
|
}
|
|
202483
202489
|
return `${prefix}${srcUrl(srcPath, projectRoot)}${suffix}`;
|
|
202484
202490
|
});
|
|
202485
202491
|
result = result.replace(/(import\s*\(\s*["'])(\.\.?\/[^"']+)(["']\s*\))/g, (_match, prefix, relPath, suffix) => {
|
|
202486
202492
|
const absPath = resolve17(fileDir, relPath);
|
|
202487
|
-
const rel =
|
|
202493
|
+
const rel = relative8(projectRoot, absPath);
|
|
202488
202494
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202489
202495
|
});
|
|
202490
202496
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => {
|
|
202491
202497
|
const absPath = resolve17(fileDir, relPath);
|
|
202492
|
-
const rel =
|
|
202498
|
+
const rel = relative8(projectRoot, absPath);
|
|
202493
202499
|
let srcPath = rel;
|
|
202494
202500
|
if (!extname3(srcPath)) {
|
|
202495
202501
|
const extensions = [
|
|
@@ -202513,10 +202519,10 @@ ${stubs}
|
|
|
202513
202519
|
});
|
|
202514
202520
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
202515
202521
|
if (absPath.startsWith(projectRoot)) {
|
|
202516
|
-
const rel2 =
|
|
202522
|
+
const rel2 = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202517
202523
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
202518
202524
|
}
|
|
202519
|
-
const rel =
|
|
202525
|
+
const rel = relative8(projectRoot, absPath).replace(/\\/g, "/");
|
|
202520
202526
|
if (!rel.startsWith("..")) {
|
|
202521
202527
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
202522
202528
|
}
|
|
@@ -202558,7 +202564,7 @@ ${stubs}
|
|
|
202558
202564
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
202559
202565
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
202560
202566
|
` + transpiled;
|
|
202561
|
-
const relPath =
|
|
202567
|
+
const relPath = relative8(projectRoot, filePath).replace(/\\/g, "/");
|
|
202562
202568
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
202563
202569
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
202564
202570
|
}, transformPlainFile = (filePath, projectRoot, rewriter) => {
|
|
@@ -202625,11 +202631,11 @@ ${stubs}
|
|
|
202625
202631
|
if (compiled.css?.code) {
|
|
202626
202632
|
const cssPath = `${filePath}.css`;
|
|
202627
202633
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
202628
|
-
const cssUrl = srcUrl(
|
|
202634
|
+
const cssUrl = srcUrl(relative8(projectRoot, cssPath), projectRoot);
|
|
202629
202635
|
code = `import "${cssUrl}";
|
|
202630
202636
|
${code}`;
|
|
202631
202637
|
}
|
|
202632
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
202638
|
+
const moduleUrl = `${SRC_PREFIX}${relative8(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
202633
202639
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
202634
202640
|
if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
202635
202641
|
var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -202693,7 +202699,7 @@ ${code}`;
|
|
|
202693
202699
|
}
|
|
202694
202700
|
code = tsTranspiler2.transformSync(code);
|
|
202695
202701
|
const hmrBase = vueDir ? resolve17(vueDir) : projectRoot;
|
|
202696
|
-
const hmrId =
|
|
202702
|
+
const hmrId = relative8(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
202697
202703
|
code = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
202698
202704
|
code += [
|
|
202699
202705
|
"",
|
|
@@ -203056,7 +203062,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
203056
203062
|
// src/dev/rebuildTrigger.ts
|
|
203057
203063
|
import { existsSync as existsSync14 } from "fs";
|
|
203058
203064
|
import { rm as rm8 } from "fs/promises";
|
|
203059
|
-
import { basename as basename8, relative as
|
|
203065
|
+
import { basename as basename8, relative as relative9, resolve as resolve20 } from "path";
|
|
203060
203066
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
203061
203067
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
203062
203068
|
if (pathLineCol) {
|
|
@@ -203490,7 +203496,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203490
203496
|
}, getModuleUrl = async (pageFile) => {
|
|
203491
203497
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
203492
203498
|
invalidateModule2(pageFile);
|
|
203493
|
-
const rel =
|
|
203499
|
+
const rel = relative9(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
203494
203500
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
203495
203501
|
warmCache2(url);
|
|
203496
203502
|
return url;
|
|
@@ -203527,7 +203533,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203527
203533
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
203528
203534
|
if (pageModuleUrl) {
|
|
203529
203535
|
const serverDuration = Date.now() - startTime;
|
|
203530
|
-
state.lastHmrPath =
|
|
203536
|
+
state.lastHmrPath = relative9(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
203531
203537
|
state.lastHmrFramework = "react";
|
|
203532
203538
|
broadcastToClients(state, {
|
|
203533
203539
|
data: {
|
|
@@ -203913,7 +203919,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
203913
203919
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
203914
203920
|
const pascalName = toPascal(baseName);
|
|
203915
203921
|
const vueRoot = config.vueDirectory;
|
|
203916
|
-
const hmrId = vueRoot ?
|
|
203922
|
+
const hmrId = vueRoot ? relative9(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
203917
203923
|
const cssKey = `${pascalName}CSS`;
|
|
203918
203924
|
const cssUrl = manifest[cssKey] || null;
|
|
203919
203925
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
@@ -204907,5 +204913,5 @@ export {
|
|
|
204907
204913
|
build
|
|
204908
204914
|
};
|
|
204909
204915
|
|
|
204910
|
-
//# debugId=
|
|
204916
|
+
//# debugId=5313682BFB4A502164756E2164756E21
|
|
204911
204917
|
//# sourceMappingURL=build.js.map
|