@absolutejs/absolute 0.19.0-beta.764 → 0.19.0-beta.765
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 +84 -16
- package/dist/build.js.map +4 -4
- package/dist/cli/index.js +1 -0
- package/dist/index.js +87 -18
- package/dist/index.js.map +5 -5
- package/dist/src/build/generateManifest.d.ts +1 -1
- package/dist/src/core/build.d.ts +7 -2
- package/dist/src/utils/loadConfig.d.ts +1 -0
- package/dist/types/build.d.ts +15 -0
- package/package.json +7 -7
package/dist/build.js
CHANGED
|
@@ -289,6 +289,15 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
289
289
|
if (isFromReact || isFromVue || isFromSvelte || isFromAngular)
|
|
290
290
|
return `${pascalName}BundledCSS`;
|
|
291
291
|
return `${pascalName}CSS`;
|
|
292
|
+
}, getArtifactBaseName = (fileName, hash) => {
|
|
293
|
+
const ext = extname(fileName);
|
|
294
|
+
const stem = ext ? fileName.slice(0, -ext.length) : fileName;
|
|
295
|
+
if (!hash)
|
|
296
|
+
return stem;
|
|
297
|
+
const hashSuffix = `.${hash}`;
|
|
298
|
+
if (stem.endsWith(hashSuffix))
|
|
299
|
+
return stem.slice(0, -hashSuffix.length);
|
|
300
|
+
return stem;
|
|
292
301
|
}, generateManifest = (outputs, buildPath) => outputs.reduce((manifest, artifact) => {
|
|
293
302
|
const normalizedArtifactPath = normalizePath(artifact.path);
|
|
294
303
|
const normalizedBuildPath = normalizePath(buildPath);
|
|
@@ -298,7 +307,7 @@ var getManifestKey = (folder, pascalName, isClientComponent, isReact, isVue, isS
|
|
|
298
307
|
const fileWithHash = segments.pop();
|
|
299
308
|
if (!fileWithHash)
|
|
300
309
|
return manifest;
|
|
301
|
-
const
|
|
310
|
+
const baseName = getArtifactBaseName(fileWithHash, artifact.hash);
|
|
302
311
|
if (!baseName)
|
|
303
312
|
return manifest;
|
|
304
313
|
const pascalName = toPascal(baseName);
|
|
@@ -45515,7 +45524,43 @@ ${content.slice(firstUseIdx)}`;
|
|
|
45515
45524
|
if (changed)
|
|
45516
45525
|
writeFileSync7(outputPath, content);
|
|
45517
45526
|
}
|
|
45518
|
-
}, vueFeatureFlags,
|
|
45527
|
+
}, vueFeatureFlags, bunBuildPassKeys, bunBuildPassKeySet, reservedBunBuildConfigKeys, isObject = (value2) => typeof value2 === "object" && value2 !== null, isBunBuildPassConfig = (config) => isObject(config) && Object.keys(config).some((key) => bunBuildPassKeySet.has(key)), sanitizeBunBuildOverride = (override) => {
|
|
45528
|
+
if (!override)
|
|
45529
|
+
return {};
|
|
45530
|
+
const sanitized = { ...override };
|
|
45531
|
+
for (const key of reservedBunBuildConfigKeys) {
|
|
45532
|
+
delete sanitized[key];
|
|
45533
|
+
}
|
|
45534
|
+
return sanitized;
|
|
45535
|
+
}, resolveBunBuildOverride = (config, pass) => {
|
|
45536
|
+
if (!config)
|
|
45537
|
+
return {};
|
|
45538
|
+
if (!isBunBuildPassConfig(config)) {
|
|
45539
|
+
return sanitizeBunBuildOverride(config);
|
|
45540
|
+
}
|
|
45541
|
+
return sanitizeBunBuildOverride({
|
|
45542
|
+
...config.default ?? {},
|
|
45543
|
+
...config[pass] ?? {}
|
|
45544
|
+
});
|
|
45545
|
+
}, dedupe = (values) => [...new Set(values)], mergeBunBuildConfig = (base, override) => {
|
|
45546
|
+
const sanitized = sanitizeBunBuildOverride(override);
|
|
45547
|
+
const merged = {
|
|
45548
|
+
...base,
|
|
45549
|
+
...sanitized
|
|
45550
|
+
};
|
|
45551
|
+
return {
|
|
45552
|
+
...merged,
|
|
45553
|
+
define: base.define || sanitized.define ? {
|
|
45554
|
+
...sanitized.define ?? {},
|
|
45555
|
+
...base.define ?? {}
|
|
45556
|
+
} : undefined,
|
|
45557
|
+
external: dedupe([
|
|
45558
|
+
...base.external ?? [],
|
|
45559
|
+
...sanitized.external ?? []
|
|
45560
|
+
]),
|
|
45561
|
+
plugins: [...base.plugins ?? [], ...sanitized.plugins ?? []]
|
|
45562
|
+
};
|
|
45563
|
+
}, build = async ({
|
|
45519
45564
|
buildDirectory = "build",
|
|
45520
45565
|
assetsDirectory,
|
|
45521
45566
|
publicDirectory,
|
|
@@ -45530,6 +45575,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
45530
45575
|
stylePreprocessors,
|
|
45531
45576
|
postcss,
|
|
45532
45577
|
tailwind,
|
|
45578
|
+
bunBuild: bunBuildConfig,
|
|
45533
45579
|
options,
|
|
45534
45580
|
incrementalFiles,
|
|
45535
45581
|
mode
|
|
@@ -45969,20 +46015,23 @@ ${content.slice(firstUseIdx)}`;
|
|
|
45969
46015
|
...svelteVendorPaths2 ?? {}
|
|
45970
46016
|
};
|
|
45971
46017
|
const htmlScriptPlugin = hmr ? createHTMLScriptHMRPlugin(htmlDir, htmxDir) : undefined;
|
|
45972
|
-
const reactBuildConfig = reactClientEntryPoints.length > 0 ? {
|
|
46018
|
+
const reactBuildConfig = reactClientEntryPoints.length > 0 ? mergeBunBuildConfig({
|
|
45973
46019
|
entrypoints: reactClientEntryPoints,
|
|
45974
46020
|
...Object.keys(reactExternalPaths).length > 0 ? { external: Object.keys(reactExternalPaths) } : {},
|
|
45975
46021
|
format: "esm",
|
|
45976
46022
|
minify: !isDev,
|
|
45977
46023
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
45978
46024
|
outdir: buildPath,
|
|
45979
|
-
...hmr ? {
|
|
46025
|
+
...hmr ? {
|
|
46026
|
+
jsx: { development: true },
|
|
46027
|
+
reactFastRefresh: true
|
|
46028
|
+
} : {},
|
|
45980
46029
|
plugins: [stylePreprocessorPlugin2],
|
|
45981
46030
|
root: clientRoot,
|
|
45982
46031
|
splitting: true,
|
|
45983
46032
|
target: "browser",
|
|
45984
46033
|
throw: false
|
|
45985
|
-
} : undefined;
|
|
46034
|
+
}, resolveBunBuildOverride(bunBuildConfig, "reactClient")) : undefined;
|
|
45986
46035
|
if (reactDir && reactClientEntryPoints.length > 0) {
|
|
45987
46036
|
rmSync2(join20(buildPath, "react", "generated", "indexes"), {
|
|
45988
46037
|
force: true,
|
|
@@ -46009,7 +46058,7 @@ ${content.slice(firstUseIdx)}`;
|
|
|
46009
46058
|
globalCssResult,
|
|
46010
46059
|
vueCssResult
|
|
46011
46060
|
] = await Promise.all([
|
|
46012
|
-
serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7({
|
|
46061
|
+
serverEntryPoints.length > 0 ? tracePhase("bun/server", () => bunBuild7(mergeBunBuildConfig({
|
|
46013
46062
|
entrypoints: serverEntryPoints,
|
|
46014
46063
|
external: [
|
|
46015
46064
|
"react",
|
|
@@ -46031,9 +46080,9 @@ ${content.slice(firstUseIdx)}`;
|
|
|
46031
46080
|
target: "bun",
|
|
46032
46081
|
throw: false,
|
|
46033
46082
|
tsconfig: "./tsconfig.json"
|
|
46034
|
-
})) : undefined,
|
|
46083
|
+
}, resolveBunBuildOverride(bunBuildConfig, "server")))) : undefined,
|
|
46035
46084
|
reactBuildConfig ? tracePhase("bun/react-client", () => bunBuild7(reactBuildConfig)) : undefined,
|
|
46036
|
-
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7({
|
|
46085
|
+
nonReactClientEntryPoints.length > 0 ? tracePhase("bun/non-react-client", () => bunBuild7(mergeBunBuildConfig({
|
|
46037
46086
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
46038
46087
|
entrypoints: nonReactClientEntryPoints,
|
|
46039
46088
|
external: Object.keys(nonReactExternalPaths),
|
|
@@ -46051,8 +46100,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
46051
46100
|
target: "browser",
|
|
46052
46101
|
throw: false,
|
|
46053
46102
|
tsconfig: "./tsconfig.json"
|
|
46054
|
-
})) : undefined,
|
|
46055
|
-
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7({
|
|
46103
|
+
}, resolveBunBuildOverride(bunBuildConfig, "nonReactClient")))) : undefined,
|
|
46104
|
+
islandClientEntryPoints.length > 0 ? tracePhase("bun/island-client", () => bunBuild7(mergeBunBuildConfig({
|
|
46056
46105
|
define: vueDirectory ? vueFeatureFlags : undefined,
|
|
46057
46106
|
entrypoints: islandClientEntryPoints,
|
|
46058
46107
|
external: Object.keys(nonReactExternalPaths),
|
|
@@ -46069,8 +46118,8 @@ ${content.slice(firstUseIdx)}`;
|
|
|
46069
46118
|
target: "browser",
|
|
46070
46119
|
throw: false,
|
|
46071
46120
|
tsconfig: "./tsconfig.json"
|
|
46072
|
-
})) : undefined,
|
|
46073
|
-
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7({
|
|
46121
|
+
}, resolveBunBuildOverride(bunBuildConfig, "islandClient")))) : undefined,
|
|
46122
|
+
globalCssEntries.length > 0 ? tracePhase("bun/global-css", () => bunBuild7(mergeBunBuildConfig({
|
|
46074
46123
|
entrypoints: globalCssEntries,
|
|
46075
46124
|
naming: `[dir]/[name].[hash].[ext]`,
|
|
46076
46125
|
outdir: stylesDir ? join20(buildPath, basename7(stylesDir)) : buildPath,
|
|
@@ -46078,14 +46127,14 @@ ${content.slice(firstUseIdx)}`;
|
|
|
46078
46127
|
root: stylesDir || clientRoot,
|
|
46079
46128
|
target: "browser",
|
|
46080
46129
|
throw: false
|
|
46081
|
-
})) : undefined,
|
|
46082
|
-
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7({
|
|
46130
|
+
}, resolveBunBuildOverride(bunBuildConfig, "globalCss")))) : undefined,
|
|
46131
|
+
vueCssPaths.length > 0 ? tracePhase("bun/vue-css", () => bunBuild7(mergeBunBuildConfig({
|
|
46083
46132
|
entrypoints: vueCssPaths,
|
|
46084
46133
|
naming: `[name].[hash].[ext]`,
|
|
46085
46134
|
outdir: join20(buildPath, assetsPath ? basename7(assetsPath) : "assets", "css"),
|
|
46086
46135
|
target: "browser",
|
|
46087
46136
|
throw: false
|
|
46088
|
-
})) : undefined
|
|
46137
|
+
}, resolveBunBuildOverride(bunBuildConfig, "vueCss")))) : undefined
|
|
46089
46138
|
]);
|
|
46090
46139
|
const serverLogs = serverResult?.logs ?? [];
|
|
46091
46140
|
const serverOutputs = serverResult?.outputs ?? [];
|
|
@@ -46369,6 +46418,25 @@ var init_build = __esm(() => {
|
|
|
46369
46418
|
__VUE_PROD_DEVTOOLS__: isDev ? "true" : "false",
|
|
46370
46419
|
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: isDev ? "true" : "false"
|
|
46371
46420
|
};
|
|
46421
|
+
bunBuildPassKeys = [
|
|
46422
|
+
"server",
|
|
46423
|
+
"reactClient",
|
|
46424
|
+
"nonReactClient",
|
|
46425
|
+
"islandClient",
|
|
46426
|
+
"globalCss",
|
|
46427
|
+
"vueCss"
|
|
46428
|
+
];
|
|
46429
|
+
bunBuildPassKeySet = new Set(["default", ...bunBuildPassKeys]);
|
|
46430
|
+
reservedBunBuildConfigKeys = new Set([
|
|
46431
|
+
"entrypoints",
|
|
46432
|
+
"outdir",
|
|
46433
|
+
"outfile",
|
|
46434
|
+
"root",
|
|
46435
|
+
"target",
|
|
46436
|
+
"format",
|
|
46437
|
+
"throw",
|
|
46438
|
+
"compile"
|
|
46439
|
+
]);
|
|
46372
46440
|
});
|
|
46373
46441
|
|
|
46374
46442
|
// src/dev/dependencyGraph.ts
|
|
@@ -50303,5 +50371,5 @@ export {
|
|
|
50303
50371
|
build
|
|
50304
50372
|
};
|
|
50305
50373
|
|
|
50306
|
-
//# debugId=
|
|
50374
|
+
//# debugId=3403097BC857C88064756E2164756E21
|
|
50307
50375
|
//# sourceMappingURL=build.js.map
|