@absolutejs/absolute 0.19.0-beta.283 → 0.19.0-beta.284
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/build.js +136 -305
- package/dist/build.js.map +4 -5
- package/dist/index.js +160 -329
- package/dist/index.js.map +4 -5
- package/dist/vue/index.js +22 -237
- package/dist/vue/index.js.map +4 -6
- package/dist/vue/server.js +22 -237
- package/dist/vue/server.js.map +4 -6
- package/package.json +1 -1
- package/dist/src/core/vueServerModule.d.ts +0 -1
package/dist/build.js
CHANGED
|
@@ -174907,182 +174907,25 @@ var init_pageHandler3 = __esm(() => {
|
|
|
174907
174907
|
init_resolveConvention();
|
|
174908
174908
|
});
|
|
174909
174909
|
|
|
174910
|
-
// src/
|
|
174911
|
-
import {
|
|
174912
|
-
import {
|
|
174913
|
-
var
|
|
174914
|
-
|
|
174915
|
-
|
|
174916
|
-
|
|
174917
|
-
|
|
174918
|
-
|
|
174919
|
-
|
|
174920
|
-
|
|
174921
|
-
|
|
174922
|
-
|
|
174923
|
-
const specifierSet = new Set;
|
|
174924
|
-
const vueImportRegex = /^import\s+{([^}]+)}\s+from\s+['"]vue['"];?$/;
|
|
174925
|
-
lines.forEach((line) => {
|
|
174926
|
-
const match = line.match(vueImportRegex);
|
|
174927
|
-
if (!match?.[1])
|
|
174928
|
-
return;
|
|
174929
|
-
match[1].split(",").forEach((specifier) => specifierSet.add(specifier.trim()));
|
|
174930
|
-
});
|
|
174931
|
-
const nonVueLines = lines.filter((line) => !vueImportRegex.test(line));
|
|
174932
|
-
if (specifierSet.size === 0) {
|
|
174933
|
-
return nonVueLines.join(`
|
|
174934
|
-
`);
|
|
174935
|
-
}
|
|
174936
|
-
return [
|
|
174937
|
-
`import { ${[...specifierSet].join(", ")} } from "vue";`,
|
|
174938
|
-
...nonVueLines
|
|
174939
|
-
].join(`
|
|
174940
|
-
`);
|
|
174941
|
-
}, ensureRelativeImportPath2 = (from, to) => {
|
|
174942
|
-
const importPath = relative10(dirname10(from), to).replace(/\\/g, "/");
|
|
174943
|
-
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
174944
|
-
}, resolveRelativeModule3 = async (spec, from) => {
|
|
174945
|
-
if (!spec.startsWith(".")) {
|
|
174946
|
-
return null;
|
|
174947
|
-
}
|
|
174948
|
-
const basePath = resolve23(dirname10(from), spec);
|
|
174949
|
-
const candidates = [
|
|
174950
|
-
basePath,
|
|
174951
|
-
`${basePath}.ts`,
|
|
174952
|
-
`${basePath}.js`,
|
|
174953
|
-
`${basePath}.mjs`,
|
|
174954
|
-
`${basePath}.cjs`,
|
|
174955
|
-
`${basePath}.json`,
|
|
174956
|
-
join20(basePath, "index.ts"),
|
|
174957
|
-
join20(basePath, "index.js"),
|
|
174958
|
-
join20(basePath, "index.mjs"),
|
|
174959
|
-
join20(basePath, "index.cjs"),
|
|
174960
|
-
join20(basePath, "index.json")
|
|
174961
|
-
];
|
|
174962
|
-
for (const candidate of candidates) {
|
|
174963
|
-
if (await Bun.file(candidate).exists() === true) {
|
|
174964
|
-
return candidate;
|
|
174965
|
-
}
|
|
174966
|
-
}
|
|
174967
|
-
return null;
|
|
174968
|
-
}, getCachedModulePath2 = (sourcePath) => {
|
|
174969
|
-
const relativeSourcePath = relative10(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
174970
|
-
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
174971
|
-
return join20(serverCacheRoot2, `${normalizedSourcePath}.server.js`);
|
|
174972
|
-
}, resolveVueImport = async (spec, from) => {
|
|
174973
|
-
if (spec.startsWith("/")) {
|
|
174974
|
-
return spec;
|
|
174975
|
-
}
|
|
174976
|
-
if (spec.startsWith(".")) {
|
|
174977
|
-
const explicitPath = resolve23(dirname10(from), spec);
|
|
174978
|
-
if (extname5(explicitPath) === ".vue") {
|
|
174979
|
-
return explicitPath;
|
|
174980
|
-
}
|
|
174981
|
-
const candidate = `${explicitPath}.vue`;
|
|
174982
|
-
if (await Bun.file(candidate).exists() === true) {
|
|
174983
|
-
return candidate;
|
|
174984
|
-
}
|
|
174985
|
-
return null;
|
|
174986
|
-
}
|
|
174987
|
-
const resolvedPath = resolvePackageImport(spec);
|
|
174988
|
-
if (resolvedPath?.endsWith(".vue")) {
|
|
174989
|
-
return resolvedPath;
|
|
174990
|
-
}
|
|
174991
|
-
return null;
|
|
174992
|
-
}, writeIfChanged2 = async (path, content) => {
|
|
174993
|
-
const targetFile = Bun.file(path);
|
|
174994
|
-
if (await targetFile.exists() === true) {
|
|
174995
|
-
const currentContent = await targetFile.text();
|
|
174996
|
-
if (currentContent === content) {
|
|
174997
|
-
return;
|
|
174910
|
+
// src/vue/pageHandler.ts
|
|
174911
|
+
import { readdir as readdir3 } from "fs/promises";
|
|
174912
|
+
import { basename as basename9, dirname as dirname10 } from "path";
|
|
174913
|
+
var ssrDirty4 = false, resolveCurrentGeneratedVueModulePath = async (pagePath) => {
|
|
174914
|
+
const pageDirectory = dirname10(pagePath);
|
|
174915
|
+
const expectedPrefix = `${basename9(pagePath, ".js").split(".")[0]}.`;
|
|
174916
|
+
try {
|
|
174917
|
+
const pageEntries = await readdir3(pageDirectory, {
|
|
174918
|
+
withFileTypes: true
|
|
174919
|
+
});
|
|
174920
|
+
const matchingEntry = pageEntries.find((entry) => entry.isFile() && entry.name.endsWith(".js") && (entry.name === `${expectedPrefix.slice(0, -1)}.js` || entry.name.startsWith(expectedPrefix)));
|
|
174921
|
+
if (!matchingEntry) {
|
|
174922
|
+
return pagePath;
|
|
174998
174923
|
}
|
|
174924
|
+
return `${pageDirectory}/${matchingEntry.name}`;
|
|
174925
|
+
} catch {
|
|
174926
|
+
return pagePath;
|
|
174999
174927
|
}
|
|
175000
|
-
|
|
175001
|
-
}, compileVueServerModule = async (sourcePath) => {
|
|
175002
|
-
const cachedModulePath = compiledModuleCache2.get(sourcePath);
|
|
175003
|
-
if (cachedModulePath) {
|
|
175004
|
-
return cachedModulePath;
|
|
175005
|
-
}
|
|
175006
|
-
const compiler = await import("@vue/compiler-sfc");
|
|
175007
|
-
const source = await Bun.file(sourcePath).text();
|
|
175008
|
-
const { descriptor } = compiler.parse(source, {
|
|
175009
|
-
filename: sourcePath
|
|
175010
|
-
});
|
|
175011
|
-
const componentId = Bun.hash(sourcePath).toString(36);
|
|
175012
|
-
const scriptSource = descriptor.scriptSetup?.content ?? descriptor.script?.content ?? "";
|
|
175013
|
-
const importSpecs = Array.from(scriptSource.matchAll(/import\s+[\s\S]+?['"]([^'"]+)['"]/g)).map((match) => match[1]).filter((value) => value !== undefined);
|
|
175014
|
-
const resolvedVueImports = await Promise.all(importSpecs.map((spec) => resolveVueImport(spec, sourcePath)));
|
|
175015
|
-
const resolvedModuleImports = await Promise.all(importSpecs.map((spec) => resolveRelativeModule3(spec, sourcePath)));
|
|
175016
|
-
const childModulePaths = new Map;
|
|
175017
|
-
const rewrittenModulePaths = new Map;
|
|
175018
|
-
for (let index = 0;index < importSpecs.length; index += 1) {
|
|
175019
|
-
const spec = importSpecs[index];
|
|
175020
|
-
const resolvedChild = resolvedVueImports[index];
|
|
175021
|
-
if (!spec || !resolvedChild)
|
|
175022
|
-
continue;
|
|
175023
|
-
const compiledChildPath = await compileVueServerModule(resolvedChild);
|
|
175024
|
-
childModulePaths.set(spec, compiledChildPath);
|
|
175025
|
-
}
|
|
175026
|
-
for (let index = 0;index < importSpecs.length; index += 1) {
|
|
175027
|
-
const spec = importSpecs[index];
|
|
175028
|
-
const resolvedModuleImport = resolvedModuleImports[index];
|
|
175029
|
-
if (!spec || !resolvedModuleImport)
|
|
175030
|
-
continue;
|
|
175031
|
-
if (resolvedVueImports[index])
|
|
175032
|
-
continue;
|
|
175033
|
-
rewrittenModulePaths.set(spec, ensureRelativeImportPath2(getCachedModulePath2(sourcePath), resolvedModuleImport));
|
|
175034
|
-
}
|
|
175035
|
-
const hasScript = descriptor.script || descriptor.scriptSetup;
|
|
175036
|
-
const compiledScript = hasScript ? compiler.compileScript(descriptor, {
|
|
175037
|
-
id: componentId,
|
|
175038
|
-
inlineTemplate: false
|
|
175039
|
-
}) : { bindings: {}, content: "export default {};" };
|
|
175040
|
-
const strippedScript = stripExports2(compiledScript.content);
|
|
175041
|
-
const transpiledScript = transpiler4.transformSync(strippedScript).replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs2(relativeImport)}${quoteEnd}`);
|
|
175042
|
-
const ssrRenderCode = compiler.compileTemplate({
|
|
175043
|
-
compilerOptions: {
|
|
175044
|
-
bindingMetadata: compiledScript.bindings,
|
|
175045
|
-
prefixIdentifiers: true
|
|
175046
|
-
},
|
|
175047
|
-
filename: sourcePath,
|
|
175048
|
-
id: componentId,
|
|
175049
|
-
scoped: descriptor.styles.some((styleBlock) => styleBlock.scoped),
|
|
175050
|
-
source: descriptor.template?.content ?? "",
|
|
175051
|
-
ssr: true,
|
|
175052
|
-
ssrCssVars: descriptor.cssVars
|
|
175053
|
-
}).code.replace(/(['"])(\.{1,2}\/[^'"]+)(['"])/g, (_, quoteStart, relativeImport, quoteEnd) => `${quoteStart}${toJs2(relativeImport)}${quoteEnd}`);
|
|
175054
|
-
let serverCode = mergeVueImports2([
|
|
175055
|
-
transpiledScript,
|
|
175056
|
-
ssrRenderCode,
|
|
175057
|
-
"script.ssrRender = ssrRender;",
|
|
175058
|
-
descriptor.styles.some((styleBlock) => styleBlock.scoped) ? `script.__scopeId = "data-v-${componentId}";` : "",
|
|
175059
|
-
"export default script;"
|
|
175060
|
-
].filter(Boolean).join(`
|
|
175061
|
-
`));
|
|
175062
|
-
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
175063
|
-
serverCode = serverCode.replaceAll(spec, ensureRelativeImportPath2(getCachedModulePath2(sourcePath), compiledChildPath));
|
|
175064
|
-
}
|
|
175065
|
-
for (const [spec, resolvedModuleImport] of rewrittenModulePaths) {
|
|
175066
|
-
serverCode = serverCode.replaceAll(spec, resolvedModuleImport);
|
|
175067
|
-
}
|
|
175068
|
-
const compiledModulePath = getCachedModulePath2(sourcePath);
|
|
175069
|
-
await mkdir4(dirname10(compiledModulePath), { recursive: true });
|
|
175070
|
-
await writeIfChanged2(compiledModulePath, serverCode);
|
|
175071
|
-
compiledModuleCache2.set(sourcePath, compiledModulePath);
|
|
175072
|
-
return compiledModulePath;
|
|
175073
|
-
};
|
|
175074
|
-
var init_vueServerModule = __esm(() => {
|
|
175075
|
-
init_resolvePackageImport();
|
|
175076
|
-
serverCacheRoot2 = join20(process.cwd(), ".absolutejs", "islands", "vue");
|
|
175077
|
-
compiledModuleCache2 = new Map;
|
|
175078
|
-
transpiler4 = new Transpiler3({
|
|
175079
|
-
loader: "ts",
|
|
175080
|
-
target: "browser"
|
|
175081
|
-
});
|
|
175082
|
-
});
|
|
175083
|
-
|
|
175084
|
-
// src/vue/pageHandler.ts
|
|
175085
|
-
var ssrDirty4 = false, buildDirtyResponse3 = (headTag, indexPath, maybeProps) => {
|
|
174928
|
+
}, buildDirtyResponse3 = (headTag, indexPath, maybeProps) => {
|
|
175086
174929
|
const propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})};`;
|
|
175087
174930
|
const dirtyFlag = "window.__SSR_DIRTY__=true;";
|
|
175088
174931
|
const html = `<!DOCTYPE html><html>${headTag}<body><div id="root"></div>` + `<script>${propsScript}${dirtyFlag}</script>` + `<script type="module" src="${indexPath}"></script>` + `</body></html>`;
|
|
@@ -175100,20 +174943,9 @@ var ssrDirty4 = false, buildDirtyResponse3 = (headTag, indexPath, maybeProps) =>
|
|
|
175100
174943
|
if (typeof passedPageComponent === "function" || typeof passedPageComponent === "object" && passedPageComponent !== null) {
|
|
175101
174944
|
return _PageComponent;
|
|
175102
174945
|
}
|
|
175103
|
-
const
|
|
175104
|
-
|
|
175105
|
-
|
|
175106
|
-
return loadedModule.default ?? loadedModule;
|
|
175107
|
-
};
|
|
175108
|
-
if (typeof passedPageComponent === "string" && passedPageComponent.endsWith(".vue")) {
|
|
175109
|
-
return loadCompiledSourcePath(passedPageComponent);
|
|
175110
|
-
}
|
|
175111
|
-
const importedPageModule = await import(pagePath);
|
|
175112
|
-
const importedPageComponent = importedPageModule.default ?? importedPageModule;
|
|
175113
|
-
if (typeof importedPageComponent === "string" && importedPageComponent.endsWith(".vue")) {
|
|
175114
|
-
return loadCompiledSourcePath(importedPageComponent);
|
|
175115
|
-
}
|
|
175116
|
-
return importedPageComponent;
|
|
174946
|
+
const generatedPagePath = await resolveCurrentGeneratedVueModulePath(pagePath);
|
|
174947
|
+
const importedPageModule = await import(generatedPagePath);
|
|
174948
|
+
return importedPageModule.default ?? importedPageModule;
|
|
175117
174949
|
};
|
|
175118
174950
|
const ImportedPageComponent = await resolvePageComponent();
|
|
175119
174951
|
const { createSSRApp, h } = await import("vue");
|
|
@@ -175152,7 +174984,6 @@ var ssrDirty4 = false, buildDirtyResponse3 = (headTag, indexPath, maybeProps) =>
|
|
|
175152
174984
|
ssrDirty4 = true;
|
|
175153
174985
|
};
|
|
175154
174986
|
var init_pageHandler4 = __esm(() => {
|
|
175155
|
-
init_vueServerModule();
|
|
175156
174987
|
init_resolveConvention();
|
|
175157
174988
|
});
|
|
175158
174989
|
|
|
@@ -175229,7 +175060,7 @@ __export(exports_moduleServer, {
|
|
|
175229
175060
|
SRC_URL_PREFIX: () => SRC_URL_PREFIX
|
|
175230
175061
|
});
|
|
175231
175062
|
import { existsSync as existsSync19, readFileSync as readFileSync11, statSync as statSync2 } from "fs";
|
|
175232
|
-
import { basename as
|
|
175063
|
+
import { basename as basename10, dirname as dirname11, extname as extname5, resolve as resolve23, relative as relative10 } from "path";
|
|
175233
175064
|
var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
|
|
175234
175065
|
const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
|
|
175235
175066
|
const allExports = [];
|
|
@@ -175249,7 +175080,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
|
|
|
175249
175080
|
${stubs}
|
|
175250
175081
|
`;
|
|
175251
175082
|
}, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
|
|
175252
|
-
const found = extensions.find((ext) => existsSync19(
|
|
175083
|
+
const found = extensions.find((ext) => existsSync19(resolve23(projectRoot, srcPath + ext)));
|
|
175253
175084
|
return found ? srcPath + found : srcPath;
|
|
175254
175085
|
}, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
|
|
175255
175086
|
const entries = Object.entries(vendorPaths).sort(([a], [b]) => b.length - a.length);
|
|
@@ -175264,7 +175095,7 @@ ${stubs}
|
|
|
175264
175095
|
return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
|
|
175265
175096
|
}, srcUrl = (relPath, projectRoot) => {
|
|
175266
175097
|
const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
|
|
175267
|
-
const absPath =
|
|
175098
|
+
const absPath = resolve23(projectRoot, relPath);
|
|
175268
175099
|
const cached = mtimeCache.get(absPath);
|
|
175269
175100
|
if (cached !== undefined)
|
|
175270
175101
|
return `${base}?v=${buildVersion(cached, absPath)}`;
|
|
@@ -175276,17 +175107,17 @@ ${stubs}
|
|
|
175276
175107
|
return base;
|
|
175277
175108
|
}
|
|
175278
175109
|
}, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
|
|
175279
|
-
const absPath =
|
|
175280
|
-
const rel =
|
|
175281
|
-
let srcPath =
|
|
175282
|
-
if (
|
|
175283
|
-
srcPath =
|
|
175110
|
+
const absPath = resolve23(fileDir, relPath);
|
|
175111
|
+
const rel = relative10(projectRoot, absPath);
|
|
175112
|
+
let srcPath = extname5(rel) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
|
|
175113
|
+
if (extname5(srcPath) === ".svelte") {
|
|
175114
|
+
srcPath = relative10(projectRoot, resolveSvelteModulePath(resolve23(projectRoot, srcPath)));
|
|
175284
175115
|
}
|
|
175285
175116
|
return srcUrl(srcPath, projectRoot);
|
|
175286
175117
|
}, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
|
|
175287
175118
|
try {
|
|
175288
175119
|
const target = resolvePackageImport(specifier, ["browser", "import"]) ?? Bun.resolveSync(specifier, projectRoot);
|
|
175289
|
-
return
|
|
175120
|
+
return relative10(projectRoot, target);
|
|
175290
175121
|
} catch {
|
|
175291
175122
|
return;
|
|
175292
175123
|
}
|
|
@@ -175318,23 +175149,23 @@ ${stubs}
|
|
|
175318
175149
|
result = result.replace(/(import\s*["'])(\.\.?\/[^"']+)(["']\s*;?)/g, (_match, prefix, relPath, suffix) => `${prefix}${resolveRelativeImport(relPath, fileDir, projectRoot, SIDE_EFFECT_EXTENSIONS)}${suffix}`);
|
|
175319
175150
|
result = result.replace(/((?:from|import)\s*["'])(\/[^"']+\.(tsx?|jsx?|ts))(["'])/g, (_match, prefix, absPath, _ext, suffix) => {
|
|
175320
175151
|
if (absPath.startsWith(projectRoot)) {
|
|
175321
|
-
const rel2 =
|
|
175152
|
+
const rel2 = relative10(projectRoot, absPath).replace(/\\/g, "/");
|
|
175322
175153
|
return `${prefix}${srcUrl(rel2, projectRoot)}${suffix}`;
|
|
175323
175154
|
}
|
|
175324
|
-
const rel =
|
|
175155
|
+
const rel = relative10(projectRoot, absPath).replace(/\\/g, "/");
|
|
175325
175156
|
if (!rel.startsWith("..")) {
|
|
175326
175157
|
return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
|
|
175327
175158
|
}
|
|
175328
175159
|
return _match;
|
|
175329
175160
|
});
|
|
175330
175161
|
result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
|
|
175331
|
-
const absPath =
|
|
175332
|
-
const rel =
|
|
175162
|
+
const absPath = resolve23(fileDir, relPath);
|
|
175163
|
+
const rel = relative10(projectRoot, absPath);
|
|
175333
175164
|
return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
|
|
175334
175165
|
});
|
|
175335
175166
|
result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
|
|
175336
|
-
const absPath =
|
|
175337
|
-
const rel =
|
|
175167
|
+
const absPath = resolve23(fileDir, relPath);
|
|
175168
|
+
const rel = relative10(projectRoot, absPath);
|
|
175338
175169
|
return `'${srcUrl(rel, projectRoot)}'`;
|
|
175339
175170
|
});
|
|
175340
175171
|
return result;
|
|
@@ -175373,21 +175204,21 @@ ${code}`;
|
|
|
175373
175204
|
transpiled = `var $RefreshReg$ = window.$RefreshReg$ || function(){};
|
|
175374
175205
|
` + `var $RefreshSig$ = window.$RefreshSig$ || function(){ return function(t){ return t; }; };
|
|
175375
175206
|
${transpiled}`;
|
|
175376
|
-
const relPath =
|
|
175207
|
+
const relPath = relative10(projectRoot, filePath).replace(/\\/g, "/");
|
|
175377
175208
|
transpiled = transpiled.replace(/\binput\.tsx:/g, `${relPath}:`);
|
|
175378
175209
|
return rewriteImports2(transpiled, filePath, projectRoot, rewriter);
|
|
175379
175210
|
}, transformPlainFile = (filePath, projectRoot, rewriter, vueDir) => {
|
|
175380
175211
|
const raw = readFileSync11(filePath, "utf-8");
|
|
175381
|
-
const ext =
|
|
175212
|
+
const ext = extname5(filePath);
|
|
175382
175213
|
const isTS = ext === ".ts" || ext === ".tsx";
|
|
175383
175214
|
const isTSX = ext === ".tsx" || ext === ".jsx";
|
|
175384
|
-
let
|
|
175215
|
+
let transpiler4 = jsTranspiler2;
|
|
175385
175216
|
if (isTSX)
|
|
175386
|
-
|
|
175217
|
+
transpiler4 = tsxTranspiler;
|
|
175387
175218
|
else if (isTS)
|
|
175388
|
-
|
|
175389
|
-
const valueExports = isTS ?
|
|
175390
|
-
let transpiled =
|
|
175219
|
+
transpiler4 = tsTranspiler2;
|
|
175220
|
+
const valueExports = isTS ? transpiler4.scan(raw).exports : [];
|
|
175221
|
+
let transpiled = transpiler4.transformSync(raw);
|
|
175391
175222
|
if (isTS) {
|
|
175392
175223
|
transpiled = preserveTypeExports(raw, transpiled, valueExports);
|
|
175393
175224
|
}
|
|
@@ -175520,11 +175351,11 @@ ${code}`;
|
|
|
175520
175351
|
if (compiled.css?.code) {
|
|
175521
175352
|
const cssPath = `${filePath}.css`;
|
|
175522
175353
|
svelteExternalCss.set(cssPath, compiled.css.code);
|
|
175523
|
-
const cssUrl = srcUrl(
|
|
175354
|
+
const cssUrl = srcUrl(relative10(projectRoot, cssPath), projectRoot);
|
|
175524
175355
|
code = `import "${cssUrl}";
|
|
175525
175356
|
${code}`;
|
|
175526
175357
|
}
|
|
175527
|
-
const moduleUrl = `${SRC_PREFIX}${
|
|
175358
|
+
const moduleUrl = `${SRC_PREFIX}${relative10(projectRoot, filePath).replace(/\\/g, "/")}`;
|
|
175528
175359
|
code = code.replace(/if\s*\(import\.meta\.hot\)\s*\{/, `if (typeof window !== "undefined") {
|
|
175529
175360
|
` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
|
|
175530
175361
|
` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
|
|
@@ -175588,7 +175419,7 @@ ${code}`;
|
|
|
175588
175419
|
if (!vueCompiler) {
|
|
175589
175420
|
vueCompiler = await import("@vue/compiler-sfc");
|
|
175590
175421
|
}
|
|
175591
|
-
const fileName =
|
|
175422
|
+
const fileName = basename10(filePath, ".vue");
|
|
175592
175423
|
const componentId = fileName.toLowerCase();
|
|
175593
175424
|
const { descriptor } = vueCompiler.parse(raw, { filename: filePath });
|
|
175594
175425
|
const compiledScript = vueCompiler.compileScript(descriptor, {
|
|
@@ -175601,8 +175432,8 @@ ${code}`;
|
|
|
175601
175432
|
code = injectVueHmr(code, filePath, projectRoot, vueDir);
|
|
175602
175433
|
return rewriteImports2(code, filePath, projectRoot, rewriter);
|
|
175603
175434
|
}, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
|
|
175604
|
-
const hmrBase = vueDir ?
|
|
175605
|
-
const hmrId =
|
|
175435
|
+
const hmrBase = vueDir ? resolve23(vueDir) : projectRoot;
|
|
175436
|
+
const hmrId = relative10(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
|
|
175606
175437
|
let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
|
|
175607
175438
|
result += [
|
|
175608
175439
|
"",
|
|
@@ -175759,8 +175590,8 @@ export default {};
|
|
|
175759
175590
|
const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
175760
175591
|
return jsResponse(`var s=document.createElement('style');s.textContent=\`${escaped}\`;s.dataset.svelteHmr=${JSON.stringify(cssCheckPath)};var p=document.querySelector('style[data-svelte-hmr="${cssCheckPath}"]');if(p)p.remove();document.head.appendChild(s);`);
|
|
175761
175592
|
}, resolveSourcePath = (relPath, projectRoot) => {
|
|
175762
|
-
const filePath =
|
|
175763
|
-
const ext =
|
|
175593
|
+
const filePath = resolve23(projectRoot, relPath);
|
|
175594
|
+
const ext = extname5(filePath);
|
|
175764
175595
|
if (ext === ".svelte")
|
|
175765
175596
|
return { ext, filePath: resolveSvelteModulePath(filePath) };
|
|
175766
175597
|
if (ext)
|
|
@@ -175786,7 +175617,7 @@ export default {};
|
|
|
175786
175617
|
if (!TRANSPILABLE.has(ext))
|
|
175787
175618
|
return;
|
|
175788
175619
|
const stat2 = statSync2(filePath);
|
|
175789
|
-
const resolvedVueDir = vueDir ?
|
|
175620
|
+
const resolvedVueDir = vueDir ? resolve23(vueDir) : undefined;
|
|
175790
175621
|
const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
|
|
175791
175622
|
setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
|
|
175792
175623
|
return jsResponse(content);
|
|
@@ -175817,7 +175648,7 @@ export default {};
|
|
|
175817
175648
|
if (!pathname.startsWith(SRC_PREFIX))
|
|
175818
175649
|
return;
|
|
175819
175650
|
const relPath = pathname.slice(SRC_PREFIX.length);
|
|
175820
|
-
const virtualCssResponse = handleVirtualSvelteCss(
|
|
175651
|
+
const virtualCssResponse = handleVirtualSvelteCss(resolve23(projectRoot, relPath));
|
|
175821
175652
|
if (virtualCssResponse)
|
|
175822
175653
|
return virtualCssResponse;
|
|
175823
175654
|
const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
|
|
@@ -175833,11 +175664,11 @@ export default {};
|
|
|
175833
175664
|
SRC_IMPORT_RE.lastIndex = 0;
|
|
175834
175665
|
while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
|
|
175835
175666
|
if (match[1])
|
|
175836
|
-
files.push(
|
|
175667
|
+
files.push(resolve23(projectRoot, match[1]));
|
|
175837
175668
|
}
|
|
175838
175669
|
return files;
|
|
175839
175670
|
}, invalidateModule = (filePath) => {
|
|
175840
|
-
const resolved =
|
|
175671
|
+
const resolved = resolve23(filePath);
|
|
175841
175672
|
invalidate(filePath);
|
|
175842
175673
|
if (resolved !== filePath)
|
|
175843
175674
|
invalidate(resolved);
|
|
@@ -175904,11 +175735,11 @@ var exports_simpleHTMLHMR = {};
|
|
|
175904
175735
|
__export(exports_simpleHTMLHMR, {
|
|
175905
175736
|
handleHTMLUpdate: () => handleHTMLUpdate
|
|
175906
175737
|
});
|
|
175907
|
-
import { resolve as
|
|
175738
|
+
import { resolve as resolve24 } from "path";
|
|
175908
175739
|
var handleHTMLUpdate = async (htmlFilePath) => {
|
|
175909
175740
|
let htmlContent;
|
|
175910
175741
|
try {
|
|
175911
|
-
const resolvedPath =
|
|
175742
|
+
const resolvedPath = resolve24(htmlFilePath);
|
|
175912
175743
|
const file3 = Bun.file(resolvedPath);
|
|
175913
175744
|
if (!await file3.exists()) {
|
|
175914
175745
|
return null;
|
|
@@ -175934,11 +175765,11 @@ var exports_simpleHTMXHMR = {};
|
|
|
175934
175765
|
__export(exports_simpleHTMXHMR, {
|
|
175935
175766
|
handleHTMXUpdate: () => handleHTMXUpdate
|
|
175936
175767
|
});
|
|
175937
|
-
import { resolve as
|
|
175768
|
+
import { resolve as resolve25 } from "path";
|
|
175938
175769
|
var handleHTMXUpdate = async (htmxFilePath) => {
|
|
175939
175770
|
let htmlContent;
|
|
175940
175771
|
try {
|
|
175941
|
-
const resolvedPath =
|
|
175772
|
+
const resolvedPath = resolve25(htmxFilePath);
|
|
175942
175773
|
const file3 = Bun.file(resolvedPath);
|
|
175943
175774
|
if (!await file3.exists()) {
|
|
175944
175775
|
return null;
|
|
@@ -175962,7 +175793,7 @@ var init_simpleHTMXHMR = () => {};
|
|
|
175962
175793
|
// src/dev/rebuildTrigger.ts
|
|
175963
175794
|
import { existsSync as existsSync20 } from "fs";
|
|
175964
175795
|
import { rm as rm8 } from "fs/promises";
|
|
175965
|
-
import { basename as
|
|
175796
|
+
import { basename as basename11, relative as relative11, resolve as resolve26 } from "path";
|
|
175966
175797
|
var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
|
|
175967
175798
|
const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
|
|
175968
175799
|
if (pathLineCol) {
|
|
@@ -176034,7 +175865,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176034
175865
|
state.fileHashes.delete(filePathInSet);
|
|
176035
175866
|
try {
|
|
176036
175867
|
const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
|
|
176037
|
-
const deletedPathResolved =
|
|
175868
|
+
const deletedPathResolved = resolve26(filePathInSet);
|
|
176038
175869
|
affectedFiles.forEach((affectedFile) => {
|
|
176039
175870
|
if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
|
|
176040
175871
|
validFiles.push(affectedFile);
|
|
@@ -176078,7 +175909,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176078
175909
|
if (storedHash !== undefined && storedHash === fileHash) {
|
|
176079
175910
|
return;
|
|
176080
175911
|
}
|
|
176081
|
-
const normalizedFilePath =
|
|
175912
|
+
const normalizedFilePath = resolve26(filePathInSet);
|
|
176082
175913
|
if (!processedFiles.has(normalizedFilePath)) {
|
|
176083
175914
|
validFiles.push(normalizedFilePath);
|
|
176084
175915
|
processedFiles.add(normalizedFilePath);
|
|
@@ -176156,8 +175987,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176156
175987
|
}
|
|
176157
175988
|
if (framework === "unknown") {
|
|
176158
175989
|
const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
|
|
176159
|
-
invalidate2(
|
|
176160
|
-
const relPath =
|
|
175990
|
+
invalidate2(resolve26(filePath));
|
|
175991
|
+
const relPath = relative11(process.cwd(), filePath);
|
|
176161
175992
|
logHmrUpdate(relPath);
|
|
176162
175993
|
return;
|
|
176163
175994
|
}
|
|
@@ -176202,7 +176033,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176202
176033
|
}
|
|
176203
176034
|
if (!graph)
|
|
176204
176035
|
return componentFile;
|
|
176205
|
-
const dependents = graph.dependents.get(
|
|
176036
|
+
const dependents = graph.dependents.get(resolve26(componentFile));
|
|
176206
176037
|
if (!dependents)
|
|
176207
176038
|
return componentFile;
|
|
176208
176039
|
for (const dep of dependents) {
|
|
@@ -176211,7 +176042,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176211
176042
|
}
|
|
176212
176043
|
return componentFile;
|
|
176213
176044
|
}, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
|
|
176214
|
-
const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") &&
|
|
176045
|
+
const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") && resolve26(file3).startsWith(angularPagesPath));
|
|
176215
176046
|
if (pageEntries.length > 0 || !state.dependencyGraph) {
|
|
176216
176047
|
return pageEntries;
|
|
176217
176048
|
}
|
|
@@ -176220,7 +176051,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176220
176051
|
const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
|
|
176221
176052
|
const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
|
|
176222
176053
|
affected.forEach((file3) => {
|
|
176223
|
-
if (file3.endsWith(".ts") &&
|
|
176054
|
+
if (file3.endsWith(".ts") && resolve26(file3).startsWith(angularPagesPath)) {
|
|
176224
176055
|
resolvedPages.add(file3);
|
|
176225
176056
|
}
|
|
176226
176057
|
});
|
|
@@ -176237,7 +176068,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176237
176068
|
const { commonAncestor: commonAncestor2 } = await Promise.resolve().then(() => (init_commonAncestor(), exports_commonAncestor));
|
|
176238
176069
|
return clientRoots.length === 1 ? clientRoots[0] ?? process.cwd() : commonAncestor2(clientRoots, process.cwd());
|
|
176239
176070
|
}, updateServerManifestEntry = (state, artifact) => {
|
|
176240
|
-
const fileWithHash =
|
|
176071
|
+
const fileWithHash = basename11(artifact.path);
|
|
176241
176072
|
const [baseName] = fileWithHash.split(`.${artifact.hash}.`);
|
|
176242
176073
|
if (!baseName) {
|
|
176243
176074
|
return;
|
|
@@ -176277,7 +176108,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176277
176108
|
await populateAssetStore(state.assetStore, clientManifest, buildDir);
|
|
176278
176109
|
}, broadcastAngularPageUpdates = (state, pagesToUpdate, manifest, startTime) => {
|
|
176279
176110
|
pagesToUpdate.forEach((angularPagePath) => {
|
|
176280
|
-
const fileName =
|
|
176111
|
+
const fileName = basename11(angularPagePath);
|
|
176281
176112
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
176282
176113
|
const pascalName = toPascal(baseName);
|
|
176283
176114
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -176300,8 +176131,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176300
176131
|
const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
|
|
176301
176132
|
const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true);
|
|
176302
176133
|
serverPaths.forEach((serverPath) => {
|
|
176303
|
-
const fileBase =
|
|
176304
|
-
state.manifest[toPascal(fileBase)] =
|
|
176134
|
+
const fileBase = basename11(serverPath, ".js");
|
|
176135
|
+
state.manifest[toPascal(fileBase)] = resolve26(serverPath);
|
|
176305
176136
|
});
|
|
176306
176137
|
if (clientPaths.length > 0) {
|
|
176307
176138
|
await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
|
|
@@ -176310,16 +176141,16 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176310
176141
|
const angularDir = config.angularDirectory ?? "";
|
|
176311
176142
|
const angularFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "angular");
|
|
176312
176143
|
for (const file3 of angularFiles) {
|
|
176313
|
-
state.fileHashes.set(
|
|
176144
|
+
state.fileHashes.set(resolve26(file3), computeFileHash(file3));
|
|
176314
176145
|
}
|
|
176315
|
-
const angularPagesPath =
|
|
176146
|
+
const angularPagesPath = resolve26(angularDir, "pages");
|
|
176316
176147
|
const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
|
|
176317
176148
|
if (pageEntries.length > 0) {
|
|
176318
176149
|
await compileAndBundleAngular(state, pageEntries, angularDir);
|
|
176319
176150
|
invalidateAngularSsrCache();
|
|
176320
176151
|
}
|
|
176321
176152
|
if (pageEntries.length > 0) {
|
|
176322
|
-
await rm8(
|
|
176153
|
+
await rm8(resolve26(angularDir, "generated"), {
|
|
176323
176154
|
force: true,
|
|
176324
176155
|
recursive: true
|
|
176325
176156
|
});
|
|
@@ -176332,8 +176163,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176332
176163
|
onRebuildComplete({ hmrState: state, manifest });
|
|
176333
176164
|
return manifest;
|
|
176334
176165
|
}, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
|
|
176335
|
-
const pageName =
|
|
176336
|
-
const indexPath =
|
|
176166
|
+
const pageName = basename11(normalized, ".tsx");
|
|
176167
|
+
const indexPath = resolve26(reactIndexesPath, `${pageName}.tsx`);
|
|
176337
176168
|
if (!existsSync20(indexPath)) {
|
|
176338
176169
|
return;
|
|
176339
176170
|
}
|
|
@@ -176344,14 +176175,14 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176344
176175
|
if (!dep.startsWith(pagesPathResolved)) {
|
|
176345
176176
|
return;
|
|
176346
176177
|
}
|
|
176347
|
-
const pageName =
|
|
176348
|
-
const indexPath =
|
|
176178
|
+
const pageName = basename11(dep, ".tsx");
|
|
176179
|
+
const indexPath = resolve26(reactIndexesPath, `${pageName}.tsx`);
|
|
176349
176180
|
if (existsSync20(indexPath) && !reactEntries.includes(indexPath)) {
|
|
176350
176181
|
reactEntries.push(indexPath);
|
|
176351
176182
|
}
|
|
176352
176183
|
});
|
|
176353
176184
|
}, resolveReactEntryForFile = (state, file3, pagesPathResolved, reactIndexesPath, reactEntries) => {
|
|
176354
|
-
const normalized =
|
|
176185
|
+
const normalized = resolve26(file3);
|
|
176355
176186
|
if (!normalized.startsWith(pagesPathResolved)) {
|
|
176356
176187
|
resolveReactEntriesFromDeps(state, normalized, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
176357
176188
|
return;
|
|
@@ -176362,7 +176193,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176362
176193
|
}
|
|
176363
176194
|
}, collectReactEntries = (state, filesToRebuild, reactPagesPath, reactIndexesPath) => {
|
|
176364
176195
|
const reactEntries = [];
|
|
176365
|
-
const pagesPathResolved =
|
|
176196
|
+
const pagesPathResolved = resolve26(reactPagesPath);
|
|
176366
176197
|
filesToRebuild.forEach((file3) => {
|
|
176367
176198
|
resolveReactEntryForFile(state, file3, pagesPathResolved, reactIndexesPath, reactEntries);
|
|
176368
176199
|
});
|
|
@@ -176373,7 +176204,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176373
176204
|
const { getDevVendorPaths: getDevVendorPaths2 } = await Promise.resolve().then(() => exports_devVendorPaths);
|
|
176374
176205
|
const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
|
|
176375
176206
|
const clientRoot = await computeClientRoot(state.resolvedPaths);
|
|
176376
|
-
const refreshEntry =
|
|
176207
|
+
const refreshEntry = resolve26(reactIndexesPath, "_refresh.tsx");
|
|
176377
176208
|
if (!reactEntries.includes(refreshEntry)) {
|
|
176378
176209
|
reactEntries.push(refreshEntry);
|
|
176379
176210
|
}
|
|
@@ -176385,7 +176216,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176385
176216
|
setDevVendorPaths2(vendorPaths);
|
|
176386
176217
|
}
|
|
176387
176218
|
const { rmSync: rmSync3 } = await import("fs");
|
|
176388
|
-
rmSync3(
|
|
176219
|
+
rmSync3(resolve26(buildDir, "react", "indexes"), {
|
|
176389
176220
|
force: true,
|
|
176390
176221
|
recursive: true
|
|
176391
176222
|
});
|
|
@@ -176414,7 +176245,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176414
176245
|
}, getModuleUrl = async (pageFile) => {
|
|
176415
176246
|
const { invalidateModule: invalidateModule2, warmCache: warmCache2, SRC_URL_PREFIX: SRC_URL_PREFIX2 } = await Promise.resolve().then(() => (init_moduleServer(), exports_moduleServer));
|
|
176416
176247
|
invalidateModule2(pageFile);
|
|
176417
|
-
const rel =
|
|
176248
|
+
const rel = relative11(process.cwd(), pageFile).replace(/\\/g, "/");
|
|
176418
176249
|
const url = `${SRC_URL_PREFIX2}${rel}`;
|
|
176419
176250
|
warmCache2(url);
|
|
176420
176251
|
return url;
|
|
@@ -176423,11 +176254,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176423
176254
|
if (isComponentFile2)
|
|
176424
176255
|
return primaryFile;
|
|
176425
176256
|
const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
|
|
176426
|
-
const nearest = findNearestComponent2(
|
|
176257
|
+
const nearest = findNearestComponent2(resolve26(primaryFile));
|
|
176427
176258
|
return nearest ?? primaryFile;
|
|
176428
176259
|
}, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
|
|
176429
176260
|
for (const file3 of reactFiles) {
|
|
176430
|
-
state.fileHashes.set(
|
|
176261
|
+
state.fileHashes.set(resolve26(file3), computeFileHash(file3));
|
|
176431
176262
|
}
|
|
176432
176263
|
invalidateReactSsrCache();
|
|
176433
176264
|
const primaryFile = reactFiles.find((file3) => !file3.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
|
|
@@ -176446,7 +176277,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176446
176277
|
const pageModuleUrl = await getReactModuleUrl(broadcastTarget);
|
|
176447
176278
|
if (pageModuleUrl) {
|
|
176448
176279
|
const serverDuration = Date.now() - startTime;
|
|
176449
|
-
state.lastHmrPath =
|
|
176280
|
+
state.lastHmrPath = relative11(process.cwd(), primaryFile).replace(/\\/g, "/");
|
|
176450
176281
|
state.lastHmrFramework = "react";
|
|
176451
176282
|
broadcastToClients(state, {
|
|
176452
176283
|
data: {
|
|
@@ -176469,8 +176300,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176469
176300
|
return state.manifest;
|
|
176470
176301
|
}, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
|
|
176471
176302
|
const reactDir = config.reactDirectory ?? "";
|
|
176472
|
-
const reactPagesPath =
|
|
176473
|
-
const reactIndexesPath =
|
|
176303
|
+
const reactPagesPath = resolve26(reactDir, "pages");
|
|
176304
|
+
const reactIndexesPath = resolve26(reactDir, "generated", "indexes");
|
|
176474
176305
|
const { buildDir } = state.resolvedPaths;
|
|
176475
176306
|
const reactFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "react");
|
|
176476
176307
|
if (reactFiles.length > 0) {
|
|
@@ -176482,7 +176313,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176482
176313
|
if (reactEntries.length > 0) {
|
|
176483
176314
|
await bundleReactClient(state, reactEntries, reactIndexesPath, buildDir);
|
|
176484
176315
|
}
|
|
176485
|
-
await rm8(
|
|
176316
|
+
await rm8(resolve26(reactDir, "generated"), { force: true, recursive: true });
|
|
176486
176317
|
const { manifest } = state;
|
|
176487
176318
|
const duration = Date.now() - startTime;
|
|
176488
176319
|
const reactPageFiles = reactFiles.filter((file3) => file3.replace(/\\/g, "/").includes("/pages/"));
|
|
@@ -176534,7 +176365,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176534
176365
|
});
|
|
176535
176366
|
}, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
|
|
176536
176367
|
for (const file3 of svelteFiles) {
|
|
176537
|
-
state.fileHashes.set(
|
|
176368
|
+
state.fileHashes.set(resolve26(file3), computeFileHash(file3));
|
|
176538
176369
|
}
|
|
176539
176370
|
invalidateSvelteSsrCache();
|
|
176540
176371
|
const serverDuration = Date.now() - startTime;
|
|
@@ -176560,8 +176391,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176560
176391
|
const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true);
|
|
176561
176392
|
const serverEntries = [...svelteServerPaths];
|
|
176562
176393
|
const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
|
|
176563
|
-
const serverRoot =
|
|
176564
|
-
const serverOutDir =
|
|
176394
|
+
const serverRoot = resolve26(svelteDir, "generated", "server");
|
|
176395
|
+
const serverOutDir = resolve26(buildDir, basename11(svelteDir));
|
|
176565
176396
|
const [serverResult, clientResult] = await Promise.all([
|
|
176566
176397
|
serverEntries.length > 0 ? bunBuild7({
|
|
176567
176398
|
entrypoints: serverEntries,
|
|
@@ -176586,7 +176417,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176586
176417
|
handleServerManifestUpdate(state, serverResult);
|
|
176587
176418
|
await handleClientManifestUpdate(state, clientResult, buildDir);
|
|
176588
176419
|
}
|
|
176589
|
-
await rm8(
|
|
176420
|
+
await rm8(resolve26(svelteDir, "generated"), {
|
|
176590
176421
|
force: true,
|
|
176591
176422
|
recursive: true
|
|
176592
176423
|
});
|
|
@@ -176594,7 +176425,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176594
176425
|
const duration = Date.now() - startTime;
|
|
176595
176426
|
const broadcastFiles = svelteFiles.length > 0 ? svelteFiles : filesToRebuild;
|
|
176596
176427
|
broadcastFiles.forEach((sveltePagePath) => {
|
|
176597
|
-
const fileName =
|
|
176428
|
+
const fileName = basename11(sveltePagePath);
|
|
176598
176429
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
176599
176430
|
const pascalName = toPascal(baseName);
|
|
176600
176431
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -176649,7 +176480,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176649
176480
|
});
|
|
176650
176481
|
}, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
|
|
176651
176482
|
for (const file3 of [...vueFiles, ...nonVueFiles]) {
|
|
176652
|
-
state.fileHashes.set(
|
|
176483
|
+
state.fileHashes.set(resolve26(file3), computeFileHash(file3));
|
|
176653
176484
|
}
|
|
176654
176485
|
invalidateVueSsrCache();
|
|
176655
176486
|
await invalidateNonVueModules(nonVueFiles);
|
|
@@ -176722,7 +176553,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176722
176553
|
});
|
|
176723
176554
|
}
|
|
176724
176555
|
}, handleScriptUpdate = (state, scriptFile, manifest, framework, duration) => {
|
|
176725
|
-
const scriptBaseName =
|
|
176556
|
+
const scriptBaseName = basename11(scriptFile).replace(/\.(ts|js|tsx|jsx)$/, "");
|
|
176726
176557
|
const pascalName = toPascal(scriptBaseName);
|
|
176727
176558
|
const scriptPath = manifest[pascalName] || null;
|
|
176728
176559
|
if (!scriptPath) {
|
|
@@ -176758,10 +176589,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176758
176589
|
}, computeOutputPagesDir = (state, config, framework) => {
|
|
176759
176590
|
const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
|
|
176760
176591
|
if (isSingle) {
|
|
176761
|
-
return
|
|
176592
|
+
return resolve26(state.resolvedPaths.buildDir, "pages");
|
|
176762
176593
|
}
|
|
176763
|
-
const dirName = framework === "html" ?
|
|
176764
|
-
return
|
|
176594
|
+
const dirName = framework === "html" ? basename11(config.htmlDirectory ?? "html") : basename11(config.htmxDirectory ?? "htmx");
|
|
176595
|
+
return resolve26(state.resolvedPaths.buildDir, dirName, "pages");
|
|
176765
176596
|
}, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
|
|
176766
176597
|
try {
|
|
176767
176598
|
const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
|
|
@@ -176796,8 +176627,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176796
176627
|
const htmlPageFiles = htmlFrameworkFiles.filter((file3) => file3.endsWith(".html"));
|
|
176797
176628
|
const outputHtmlPages = computeOutputPagesDir(state, config, "html");
|
|
176798
176629
|
for (const pageFile of htmlPageFiles) {
|
|
176799
|
-
const htmlPageName =
|
|
176800
|
-
const builtHtmlPagePath =
|
|
176630
|
+
const htmlPageName = basename11(pageFile);
|
|
176631
|
+
const builtHtmlPagePath = resolve26(outputHtmlPages, htmlPageName);
|
|
176801
176632
|
await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
|
|
176802
176633
|
}
|
|
176803
176634
|
}, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
|
|
@@ -176805,7 +176636,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176805
176636
|
if (!cssFile) {
|
|
176806
176637
|
return;
|
|
176807
176638
|
}
|
|
176808
|
-
const cssBaseName =
|
|
176639
|
+
const cssBaseName = basename11(cssFile, ".css");
|
|
176809
176640
|
const cssPascalName = toPascal(cssBaseName);
|
|
176810
176641
|
const cssKey = `${cssPascalName}CSS`;
|
|
176811
176642
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -176854,15 +176685,15 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176854
176685
|
type: "vue-update"
|
|
176855
176686
|
});
|
|
176856
176687
|
}, broadcastVuePageChange = async (state, config, vuePagePath, manifest, duration) => {
|
|
176857
|
-
const fileName =
|
|
176688
|
+
const fileName = basename11(vuePagePath);
|
|
176858
176689
|
const baseName = fileName.replace(/\.vue$/, "");
|
|
176859
176690
|
const pascalName = toPascal(baseName);
|
|
176860
176691
|
const vueRoot = config.vueDirectory;
|
|
176861
|
-
const hmrId = vueRoot ?
|
|
176692
|
+
const hmrId = vueRoot ? relative11(vueRoot, vuePagePath).replace(/\\/g, "/").replace(/\.vue$/, "") : baseName;
|
|
176862
176693
|
const cssKey = `${pascalName}CSS`;
|
|
176863
176694
|
const cssUrl = manifest[cssKey] || null;
|
|
176864
176695
|
const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
|
|
176865
|
-
const hmrMeta = vueHmrMetadata2.get(
|
|
176696
|
+
const hmrMeta = vueHmrMetadata2.get(resolve26(vuePagePath));
|
|
176866
176697
|
const changeType = hmrMeta?.changeType ?? "full";
|
|
176867
176698
|
if (changeType === "style-only") {
|
|
176868
176699
|
broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
|
|
@@ -176902,7 +176733,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176902
176733
|
if (!cssFile) {
|
|
176903
176734
|
return;
|
|
176904
176735
|
}
|
|
176905
|
-
const cssBaseName =
|
|
176736
|
+
const cssBaseName = basename11(cssFile, ".css");
|
|
176906
176737
|
const cssPascalName = toPascal(cssBaseName);
|
|
176907
176738
|
const cssKey = `${cssPascalName}CSS`;
|
|
176908
176739
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -176920,7 +176751,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176920
176751
|
});
|
|
176921
176752
|
}, broadcastSveltePageUpdate = (state, sveltePagePath, manifest, duration) => {
|
|
176922
176753
|
try {
|
|
176923
|
-
const fileName =
|
|
176754
|
+
const fileName = basename11(sveltePagePath);
|
|
176924
176755
|
const baseName = fileName.replace(/\.svelte$/, "");
|
|
176925
176756
|
const pascalName = toPascal(baseName);
|
|
176926
176757
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -176982,7 +176813,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
176982
176813
|
if (!cssFile) {
|
|
176983
176814
|
return;
|
|
176984
176815
|
}
|
|
176985
|
-
const cssBaseName =
|
|
176816
|
+
const cssBaseName = basename11(cssFile, ".css");
|
|
176986
176817
|
const cssPascalName = toPascal(cssBaseName);
|
|
176987
176818
|
const cssKey = `${cssPascalName}CSS`;
|
|
176988
176819
|
const cssUrl = manifest[cssKey] || null;
|
|
@@ -177000,7 +176831,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
177000
176831
|
});
|
|
177001
176832
|
}, broadcastAngularPageHmrUpdate = (state, angularPagePath, manifest, duration) => {
|
|
177002
176833
|
try {
|
|
177003
|
-
const fileName =
|
|
176834
|
+
const fileName = basename11(angularPagePath);
|
|
177004
176835
|
const baseName = fileName.replace(/\.[tj]s$/, "");
|
|
177005
176836
|
const pascalName = toPascal(baseName);
|
|
177006
176837
|
const cssKey = `${pascalName}CSS`;
|
|
@@ -177095,8 +176926,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
177095
176926
|
const htmxPageFiles = htmxFrameworkFiles.filter((file3) => file3.endsWith(".html"));
|
|
177096
176927
|
const outputHtmxPages = computeOutputPagesDir(state, config, "htmx");
|
|
177097
176928
|
for (const htmxPageFile of htmxPageFiles) {
|
|
177098
|
-
const htmxPageName =
|
|
177099
|
-
const builtHtmxPagePath =
|
|
176929
|
+
const htmxPageName = basename11(htmxPageFile);
|
|
176930
|
+
const builtHtmxPagePath = resolve26(outputHtmxPages, htmxPageName);
|
|
177100
176931
|
await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
|
|
177101
176932
|
}
|
|
177102
176933
|
}, collectUpdatedModulePaths = (allModuleUpdates) => {
|
|
@@ -177205,7 +177036,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
|
|
|
177205
177036
|
html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
|
|
177206
177037
|
writeFs(destPath, html);
|
|
177207
177038
|
}, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
|
|
177208
|
-
const destPath =
|
|
177039
|
+
const destPath = resolve26(outputDir, basename11(sourceFile));
|
|
177209
177040
|
const hmrScript = extractHmrScript(destPath, readFs);
|
|
177210
177041
|
const source = await Bun.file(sourceFile).text();
|
|
177211
177042
|
await Bun.write(destPath, source);
|
|
@@ -177432,7 +177263,7 @@ __export(exports_buildDepVendor, {
|
|
|
177432
177263
|
buildDepVendor: () => buildDepVendor
|
|
177433
177264
|
});
|
|
177434
177265
|
import { mkdirSync as mkdirSync11 } from "fs";
|
|
177435
|
-
import { join as
|
|
177266
|
+
import { join as join20 } from "path";
|
|
177436
177267
|
import { rm as rm9 } from "fs/promises";
|
|
177437
177268
|
var {build: bunBuild7, Glob: Glob8 } = globalThis.Bun;
|
|
177438
177269
|
var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g, "").replace(/-/g, "_"), isResolvable3 = (specifier) => {
|
|
@@ -177442,11 +177273,11 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
177442
177273
|
} catch {
|
|
177443
177274
|
return false;
|
|
177444
177275
|
}
|
|
177445
|
-
}, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), FRAMEWORK_SPECIFIERS, isSkippedFile = (file3) => file3.includes("node_modules") || file3.includes("/build/") || file3.includes("/dist/") || file3.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier(path) && !FRAMEWORK_SPECIFIERS.has(path), readFileSpecifiers = async (file3,
|
|
177276
|
+
}, isBareSpecifier = (spec) => !spec.startsWith(".") && !spec.startsWith("/") && !spec.startsWith("@src/"), FRAMEWORK_SPECIFIERS, isSkippedFile = (file3) => file3.includes("node_modules") || file3.includes("/build/") || file3.includes("/dist/") || file3.includes("/indexes/"), isDepSpecifier = (path) => isBareSpecifier(path) && !FRAMEWORK_SPECIFIERS.has(path), readFileSpecifiers = async (file3, transpiler4) => {
|
|
177446
177277
|
const empty = [];
|
|
177447
177278
|
try {
|
|
177448
177279
|
const content = await Bun.file(file3).text();
|
|
177449
|
-
return
|
|
177280
|
+
return transpiler4.scanImports(content).map((imp) => imp.path).filter(isDepSpecifier);
|
|
177450
177281
|
} catch {
|
|
177451
177282
|
return empty;
|
|
177452
177283
|
}
|
|
@@ -177459,16 +177290,16 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
177459
177290
|
} catch {
|
|
177460
177291
|
return empty;
|
|
177461
177292
|
}
|
|
177462
|
-
}, collectDirSpecifiers = async (dir,
|
|
177293
|
+
}, collectDirSpecifiers = async (dir, transpiler4, specifiers) => {
|
|
177463
177294
|
const files = await scanDirFiles(dir);
|
|
177464
|
-
const results = await Promise.all(files.map((file3) => readFileSpecifiers(file3,
|
|
177295
|
+
const results = await Promise.all(files.map((file3) => readFileSpecifiers(file3, transpiler4)));
|
|
177465
177296
|
for (const spec of results.flat()) {
|
|
177466
177297
|
specifiers.add(spec);
|
|
177467
177298
|
}
|
|
177468
177299
|
}, scanBareImports = async (directories) => {
|
|
177469
177300
|
const specifiers = new Set;
|
|
177470
|
-
const
|
|
177471
|
-
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir,
|
|
177301
|
+
const transpiler4 = new Bun.Transpiler({ loader: "tsx" });
|
|
177302
|
+
await Promise.all(directories.map((dir) => collectDirSpecifiers(dir, transpiler4, specifiers)));
|
|
177472
177303
|
return Array.from(specifiers).filter(isResolvable3);
|
|
177473
177304
|
}, generateEntrySource2 = (specifier) => `export * from '${specifier}';
|
|
177474
177305
|
`, rewriteVendorFiles = async (vendorDir) => {
|
|
@@ -177482,7 +177313,7 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
177482
177313
|
}, content);
|
|
177483
177314
|
const files = readdirSync2(vendorDir).filter((f) => f.endsWith(".js"));
|
|
177484
177315
|
for (const file3 of files) {
|
|
177485
|
-
const filePath =
|
|
177316
|
+
const filePath = join20(vendorDir, file3);
|
|
177486
177317
|
const original = readFileSync12(filePath, "utf-8");
|
|
177487
177318
|
const rewritten = rewriteContent(original);
|
|
177488
177319
|
if (rewritten !== original)
|
|
@@ -177492,13 +177323,13 @@ var toSafeFileName5 = (specifier) => specifier.replace(/\//g, "_").replace(/@/g,
|
|
|
177492
177323
|
const specifiers = await scanBareImports(directories);
|
|
177493
177324
|
if (specifiers.length === 0)
|
|
177494
177325
|
return {};
|
|
177495
|
-
const vendorDir =
|
|
177326
|
+
const vendorDir = join20(buildDir, "vendor");
|
|
177496
177327
|
mkdirSync11(vendorDir, { recursive: true });
|
|
177497
|
-
const tmpDir =
|
|
177328
|
+
const tmpDir = join20(buildDir, "_dep_vendor_tmp");
|
|
177498
177329
|
mkdirSync11(tmpDir, { recursive: true });
|
|
177499
177330
|
const entrypoints = await Promise.all(specifiers.map(async (specifier) => {
|
|
177500
177331
|
const safeName = toSafeFileName5(specifier);
|
|
177501
|
-
const entryPath =
|
|
177332
|
+
const entryPath = join20(tmpDir, `${safeName}.ts`);
|
|
177502
177333
|
const source = await generateEntrySource2(specifier);
|
|
177503
177334
|
await Bun.write(entryPath, source);
|
|
177504
177335
|
return entryPath;
|
|
@@ -177566,9 +177397,9 @@ var exports_devBuild = {};
|
|
|
177566
177397
|
__export(exports_devBuild, {
|
|
177567
177398
|
devBuild: () => devBuild
|
|
177568
177399
|
});
|
|
177569
|
-
import { readdir as
|
|
177400
|
+
import { readdir as readdir4 } from "fs/promises";
|
|
177570
177401
|
import { statSync as statSync3 } from "fs";
|
|
177571
|
-
import { resolve as
|
|
177402
|
+
import { resolve as resolve27 } from "path";
|
|
177572
177403
|
var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
177573
177404
|
const config = {};
|
|
177574
177405
|
const dirPattern = /(\w+Directory)\s*:\s*['"]([^'"]+)['"]/g;
|
|
@@ -177581,7 +177412,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177581
177412
|
return Object.keys(config).length > 0 ? config : null;
|
|
177582
177413
|
}, reloadConfig = async () => {
|
|
177583
177414
|
try {
|
|
177584
|
-
const configPath2 =
|
|
177415
|
+
const configPath2 = resolve27(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
|
|
177585
177416
|
const source = await Bun.file(configPath2).text();
|
|
177586
177417
|
return parseDirectoryConfig(source);
|
|
177587
177418
|
} catch {
|
|
@@ -177661,7 +177492,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177661
177492
|
state.fileChangeQueue.clear();
|
|
177662
177493
|
}
|
|
177663
177494
|
}, handleCachedReload = async () => {
|
|
177664
|
-
const serverMtime = statSync3(
|
|
177495
|
+
const serverMtime = statSync3(resolve27(Bun.main)).mtimeMs;
|
|
177665
177496
|
const lastMtime = globalThis.__hmrServerMtime;
|
|
177666
177497
|
globalThis.__hmrServerMtime = serverMtime;
|
|
177667
177498
|
const cached = globalThis.__hmrDevResult;
|
|
@@ -177695,8 +177526,8 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177695
177526
|
return true;
|
|
177696
177527
|
}, resolveAbsoluteVersion2 = async () => {
|
|
177697
177528
|
const candidates = [
|
|
177698
|
-
|
|
177699
|
-
|
|
177529
|
+
resolve27(import.meta.dir, "..", "..", "package.json"),
|
|
177530
|
+
resolve27(import.meta.dir, "..", "package.json")
|
|
177700
177531
|
];
|
|
177701
177532
|
for (const candidate of candidates) {
|
|
177702
177533
|
const found = await tryReadPackageVersion(candidate);
|
|
@@ -177706,10 +177537,10 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177706
177537
|
}
|
|
177707
177538
|
}, loadVendorFiles = async (assetStore, vendorDir, framework) => {
|
|
177708
177539
|
const emptyStringArray = [];
|
|
177709
|
-
const entries = await
|
|
177540
|
+
const entries = await readdir4(vendorDir).catch(() => emptyStringArray);
|
|
177710
177541
|
await Promise.all(entries.map(async (entry) => {
|
|
177711
177542
|
const webPath = `/${framework}/vendor/${entry}`;
|
|
177712
|
-
const bytes = await Bun.file(
|
|
177543
|
+
const bytes = await Bun.file(resolve27(vendorDir, entry)).bytes();
|
|
177713
177544
|
assetStore.set(webPath, bytes);
|
|
177714
177545
|
}));
|
|
177715
177546
|
}, devBuild = async (config) => {
|
|
@@ -177751,7 +177582,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177751
177582
|
await populateAssetStore(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
177752
177583
|
cleanStaleAssets(state.assetStore, manifest, state.resolvedPaths.buildDir);
|
|
177753
177584
|
const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
177754
|
-
const vendorDir =
|
|
177585
|
+
const vendorDir = resolve27(state.resolvedPaths.buildDir, "react", "vendor");
|
|
177755
177586
|
await loadVendorFiles(state.assetStore, vendorDir, "react");
|
|
177756
177587
|
if (!globalThis.__reactModuleRef) {
|
|
177757
177588
|
globalThis.__reactModuleRef = await import("react");
|
|
@@ -177759,17 +177590,17 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177759
177590
|
return true;
|
|
177760
177591
|
}) : undefined;
|
|
177761
177592
|
const buildAngularVendorTask = config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
177762
|
-
const vendorDir =
|
|
177593
|
+
const vendorDir = resolve27(state.resolvedPaths.buildDir, "angular", "vendor");
|
|
177763
177594
|
await loadVendorFiles(state.assetStore, vendorDir, "angular");
|
|
177764
177595
|
return true;
|
|
177765
177596
|
}) : undefined;
|
|
177766
177597
|
const buildSvelteVendorTask = config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
177767
|
-
const vendorDir =
|
|
177598
|
+
const vendorDir = resolve27(state.resolvedPaths.buildDir, "svelte", "vendor");
|
|
177768
177599
|
await loadVendorFiles(state.assetStore, vendorDir, "svelte");
|
|
177769
177600
|
return true;
|
|
177770
177601
|
}) : undefined;
|
|
177771
177602
|
const buildVueVendorTask = config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir).then(async () => {
|
|
177772
|
-
const vendorDir =
|
|
177603
|
+
const vendorDir = resolve27(state.resolvedPaths.buildDir, "vue", "vendor");
|
|
177773
177604
|
await loadVendorFiles(state.assetStore, vendorDir, "vue");
|
|
177774
177605
|
return true;
|
|
177775
177606
|
}) : undefined;
|
|
@@ -177783,7 +177614,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177783
177614
|
config.htmxDirectory
|
|
177784
177615
|
].filter((dir) => Boolean(dir));
|
|
177785
177616
|
const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
|
|
177786
|
-
const vendorDir =
|
|
177617
|
+
const vendorDir = resolve27(state.resolvedPaths.buildDir, "vendor");
|
|
177787
177618
|
await loadVendorFiles(state.assetStore, vendorDir, "vendor");
|
|
177788
177619
|
globalThis.__depVendorPaths = depPaths;
|
|
177789
177620
|
return true;
|
|
@@ -177814,7 +177645,7 @@ var FRAMEWORK_DIR_KEYS, parseDirectoryConfig = (source) => {
|
|
|
177814
177645
|
manifest
|
|
177815
177646
|
};
|
|
177816
177647
|
globalThis.__hmrDevResult = result;
|
|
177817
|
-
globalThis.__hmrServerMtime = statSync3(
|
|
177648
|
+
globalThis.__hmrServerMtime = statSync3(resolve27(Bun.main)).mtimeMs;
|
|
177818
177649
|
return result;
|
|
177819
177650
|
};
|
|
177820
177651
|
var init_devBuild = __esm(() => {
|
|
@@ -177849,5 +177680,5 @@ export {
|
|
|
177849
177680
|
build
|
|
177850
177681
|
};
|
|
177851
177682
|
|
|
177852
|
-
//# debugId=
|
|
177683
|
+
//# debugId=BB4AE294FD6962CE64756E2164756E21
|
|
177853
177684
|
//# sourceMappingURL=build.js.map
|