@absolutejs/absolute 0.19.0-beta.692 → 0.19.0-beta.693

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 CHANGED
@@ -2450,7 +2450,7 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
2450
2450
  // src/build/stylePreprocessor.ts
2451
2451
  import { readFile } from "fs/promises";
2452
2452
  import { createRequire } from "module";
2453
- import { dirname as dirname3, extname as extname3, join as join5 } from "path";
2453
+ import { dirname as dirname3, extname as extname3, join as join5, resolve as resolve6 } from "path";
2454
2454
  var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
2455
2455
  const normalized = filePathOrLanguage.toLowerCase();
2456
2456
  if (normalized === "scss" || normalized.endsWith(".scss"))
@@ -2460,18 +2460,29 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2460
2460
  if (normalized === "less" || normalized.endsWith(".less"))
2461
2461
  return "less";
2462
2462
  return null;
2463
- }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), compileStyleSource = async (filePath, source, languageHint) => {
2463
+ }, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), normalizeLoadPaths = (filePath, paths = []) => [
2464
+ dirname3(filePath),
2465
+ process.cwd(),
2466
+ ...paths.map((path) => resolve6(process.cwd(), path))
2467
+ ], getSassOptions = (config, language) => ({
2468
+ ...config?.sass ?? {},
2469
+ ...language === "scss" ? config?.scss ?? {} : {}
2470
+ }), getLessOptions = (config) => config?.less ?? {}, withAdditionalData = (contents, additionalData) => additionalData ? `${additionalData}
2471
+ ${contents}` : contents, compileStyleSource = async (filePath, source, languageHint, config) => {
2464
2472
  const language = getStyleLanguage(languageHint ?? filePath);
2465
- const contents = source ?? await readFile(filePath, "utf-8");
2473
+ const rawContents = source ?? await readFile(filePath, "utf-8");
2466
2474
  if (language === "scss" || language === "sass") {
2475
+ const options = getSassOptions(config, language);
2476
+ const packageName = options.implementation ?? "sass";
2467
2477
  let sass;
2468
2478
  try {
2469
- sass = await importOptionalPeer("sass");
2479
+ sass = await importOptionalPeer(packageName);
2470
2480
  } catch {
2471
- throw missingDependencyError("sass", filePath);
2481
+ throw missingDependencyError(packageName, filePath);
2472
2482
  }
2483
+ const contents = withAdditionalData(rawContents, options.additionalData);
2473
2484
  const result = sass.compileString(contents, {
2474
- loadPaths: [dirname3(filePath), process.cwd()],
2485
+ loadPaths: normalizeLoadPaths(filePath, options.loadPaths),
2475
2486
  style: "expanded",
2476
2487
  syntax: language === "sass" ? "indented" : "scss",
2477
2488
  url: new URL(`file://${filePath}`)
@@ -2479,6 +2490,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2479
2490
  return result.css;
2480
2491
  }
2481
2492
  if (language === "less") {
2493
+ const options = getLessOptions(config);
2482
2494
  let lessModule;
2483
2495
  try {
2484
2496
  lessModule = await importOptionalPeer("less");
@@ -2489,14 +2501,49 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2489
2501
  const render = less?.render;
2490
2502
  if (!render)
2491
2503
  throw missingDependencyError("less", filePath);
2504
+ const contents = withAdditionalData(rawContents, options.additionalData);
2492
2505
  const result = await render(contents, {
2506
+ ...options.options ?? {},
2493
2507
  filename: filePath,
2494
- paths: [dirname3(filePath), process.cwd()]
2508
+ paths: normalizeLoadPaths(filePath, options.paths)
2495
2509
  });
2496
2510
  return result.css;
2497
2511
  }
2498
- return contents;
2499
- }, stylePreprocessorPlugin, createSvelteStylePreprocessor = () => ({
2512
+ return rawContents;
2513
+ }, createStylePreprocessorPlugin = (config) => ({
2514
+ name: "absolute-style-preprocessor",
2515
+ setup(build) {
2516
+ const cssModuleSources = new Map;
2517
+ build.onResolve({ filter: /^absolute-style-module:/ }, ({ path }) => ({
2518
+ namespace: "absolute-style-module",
2519
+ path: path.slice("absolute-style-module:".length)
2520
+ }));
2521
+ build.onLoad({ filter: /\.module\.css$/i, namespace: "absolute-style-module" }, async ({ path }) => {
2522
+ const sourcePath = cssModuleSources.get(path);
2523
+ if (!sourcePath) {
2524
+ throw new Error(`Unable to resolve CSS module source for ${path}`);
2525
+ }
2526
+ return {
2527
+ contents: await compileStyleSource(sourcePath, undefined, undefined, config),
2528
+ loader: "css"
2529
+ };
2530
+ });
2531
+ build.onLoad({ filter: STYLE_EXTENSION_PATTERN }, async ({ path }) => {
2532
+ if (isStyleModulePath(path)) {
2533
+ const cssModulePath = path.replace(STYLE_EXTENSION_PATTERN, ".css");
2534
+ cssModuleSources.set(cssModulePath, path);
2535
+ return {
2536
+ contents: `export { default } from ${JSON.stringify(`absolute-style-module:${cssModulePath}`)};`,
2537
+ loader: "js"
2538
+ };
2539
+ }
2540
+ return {
2541
+ contents: await compileStyleSource(path, undefined, undefined, config),
2542
+ loader: "css"
2543
+ };
2544
+ });
2545
+ }
2546
+ }), stylePreprocessorPlugin, createSvelteStylePreprocessor = (config) => ({
2500
2547
  style: async ({
2501
2548
  attributes,
2502
2549
  content,
@@ -2507,14 +2554,14 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
2507
2554
  return;
2508
2555
  const path = filename ?? `style.${language}`;
2509
2556
  return {
2510
- code: await compileStyleSource(path, content, language)
2557
+ code: await compileStyleSource(path, content, language, config)
2511
2558
  };
2512
2559
  }
2513
- }), compileStyleFileIfNeeded = async (filePath) => {
2560
+ }), compileStyleFileIfNeeded = async (filePath, config) => {
2514
2561
  if (!isPreprocessableStylePath(filePath)) {
2515
2562
  return readFile(filePath, "utf-8");
2516
2563
  }
2517
- return compileStyleSource(filePath);
2564
+ return compileStyleSource(filePath, undefined, undefined, config);
2518
2565
  };
2519
2566
  var init_stylePreprocessor = __esm(() => {
2520
2567
  STYLE_EXTENSION_PATTERN = /\.(s[ac]ss|less)$/i;
@@ -2523,45 +2570,12 @@ var init_stylePreprocessor = __esm(() => {
2523
2570
  importOptionalPeer = new Function("specifier", "return import(specifier)");
2524
2571
  requireOptionalPeer = new Function("specifier", "return require(specifier)");
2525
2572
  requireFromCwd = createRequire(join5(process.cwd(), "package.json"));
2526
- stylePreprocessorPlugin = {
2527
- name: "absolute-style-preprocessor",
2528
- setup(build) {
2529
- const cssModuleSources = new Map;
2530
- build.onResolve({ filter: /^absolute-style-module:/ }, ({ path }) => ({
2531
- namespace: "absolute-style-module",
2532
- path: path.slice("absolute-style-module:".length)
2533
- }));
2534
- build.onLoad({ filter: /\.module\.css$/i, namespace: "absolute-style-module" }, async ({ path }) => {
2535
- const sourcePath = cssModuleSources.get(path);
2536
- if (!sourcePath) {
2537
- throw new Error(`Unable to resolve CSS module source for ${path}`);
2538
- }
2539
- return {
2540
- contents: await compileStyleSource(sourcePath),
2541
- loader: "css"
2542
- };
2543
- });
2544
- build.onLoad({ filter: STYLE_EXTENSION_PATTERN }, async ({ path }) => {
2545
- if (isStyleModulePath(path)) {
2546
- const cssModulePath = path.replace(STYLE_EXTENSION_PATTERN, ".css");
2547
- cssModuleSources.set(cssModulePath, path);
2548
- return {
2549
- contents: `export { default } from ${JSON.stringify(`absolute-style-module:${cssModulePath}`)};`,
2550
- loader: "js"
2551
- };
2552
- }
2553
- return {
2554
- contents: await compileStyleSource(path),
2555
- loader: "css"
2556
- };
2557
- });
2558
- }
2559
- };
2573
+ stylePreprocessorPlugin = createStylePreprocessorPlugin();
2560
2574
  });
2561
2575
 
2562
2576
  // src/core/svelteServerModule.ts
2563
2577
  import { mkdir, readdir as readdir2 } from "fs/promises";
2564
- import { basename as basename2, dirname as dirname4, extname as extname4, join as join6, relative as relative3, resolve as resolve6 } from "path";
2578
+ import { basename as basename2, dirname as dirname4, extname as extname4, join as join6, relative as relative3, resolve as resolve7 } from "path";
2565
2579
  var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
2566
2580
  const importPath = relative3(dirname4(from), target).replace(/\\/g, "/");
2567
2581
  return importPath.startsWith(".") ? importPath : `./${importPath}`;
@@ -2609,7 +2623,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2609
2623
  if (!spec.startsWith(".")) {
2610
2624
  return null;
2611
2625
  }
2612
- const basePath = resolve6(dirname4(from), spec);
2626
+ const basePath = resolve7(dirname4(from), spec);
2613
2627
  const candidates = [
2614
2628
  basePath,
2615
2629
  `${basePath}.ts`,
@@ -2641,7 +2655,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
2641
2655
  if (!spec.startsWith(".")) {
2642
2656
  return null;
2643
2657
  }
2644
- const explicitPath = resolve6(dirname4(from), spec);
2658
+ const explicitPath = resolve7(dirname4(from), spec);
2645
2659
  if (extname4(explicitPath) === ".svelte") {
2646
2660
  return explicitPath;
2647
2661
  }
@@ -3215,7 +3229,7 @@ var init_scanCssEntryPoints = __esm(() => {
3215
3229
 
3216
3230
  // src/utils/imageProcessing.ts
3217
3231
  import { existsSync as existsSync8, mkdirSync as mkdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync4 } from "fs";
3218
- import { join as join7, resolve as resolve7 } from "path";
3232
+ import { join as join7, resolve as resolve8 } from "path";
3219
3233
  var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATION_ENDPOINT = "/_absolute/image", BLUR_DEVIATION = 20, sharpModule = undefined, sharpLoaded = false, sharpWarned = false, snapToSize = (target, sizes) => {
3220
3234
  for (const size of sizes) {
3221
3235
  if (size >= target)
@@ -3341,7 +3355,7 @@ var DEFAULT_DEVICE_SIZES, DEFAULT_IMAGE_SIZES, DEFAULT_QUALITY = 75, OPTIMIZATIO
3341
3355
  return sharpModule;
3342
3356
  sharpLoaded = true;
3343
3357
  try {
3344
- const sharpPath = resolve7(process.cwd(), "node_modules/sharp");
3358
+ const sharpPath = resolve8(process.cwd(), "node_modules/sharp");
3345
3359
  const mod = await import(sharpPath);
3346
3360
  sharpModule = mod.default ?? mod;
3347
3361
  return sharpModule;
@@ -3579,18 +3593,18 @@ var init_updateAssetPaths = __esm(() => {
3579
3593
 
3580
3594
  // src/dev/buildHMRClient.ts
3581
3595
  import { existsSync as existsSync11 } from "fs";
3582
- import { resolve as resolve8 } from "path";
3596
+ import { resolve as resolve9 } from "path";
3583
3597
  var {build: bunBuild } = globalThis.Bun;
3584
3598
  var resolveHmrClientPath = () => {
3585
3599
  const projectRoot = process.cwd();
3586
- const fromSource = resolve8(import.meta.dir, "client/hmrClient.ts");
3600
+ const fromSource = resolve9(import.meta.dir, "client/hmrClient.ts");
3587
3601
  if (existsSync11(fromSource) && fromSource.startsWith(projectRoot)) {
3588
3602
  return fromSource;
3589
3603
  }
3590
- const fromNodeModules = resolve8(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
3604
+ const fromNodeModules = resolve9(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client/hmrClient.ts");
3591
3605
  if (existsSync11(fromNodeModules))
3592
3606
  return fromNodeModules;
3593
- return resolve8(import.meta.dir, "dev/client/hmrClient.ts");
3607
+ return resolve9(import.meta.dir, "dev/client/hmrClient.ts");
3594
3608
  }, hmrClientPath2, buildHMRClient = async () => {
3595
3609
  const entryPoint = hmrClientPath2;
3596
3610
  const result = await bunBuild({
@@ -3620,7 +3634,7 @@ var init_buildHMRClient = __esm(() => {
3620
3634
  // src/build/nativeRewrite.ts
3621
3635
  import { dlopen, FFIType, ptr } from "bun:ffi";
3622
3636
  import { platform as platform2, arch as arch2 } from "os";
3623
- import { resolve as resolve9 } from "path";
3637
+ import { resolve as resolve10 } from "path";
3624
3638
  var ffiDefinition, nativeLib = null, loadNative = () => {
3625
3639
  if (nativeLib !== null)
3626
3640
  return nativeLib;
@@ -3638,7 +3652,7 @@ var ffiDefinition, nativeLib = null, loadNative = () => {
3638
3652
  if (!libPath)
3639
3653
  return null;
3640
3654
  try {
3641
- const fullPath = resolve9(import.meta.dir, "../../native/packages", libPath);
3655
+ const fullPath = resolve10(import.meta.dir, "../../native/packages", libPath);
3642
3656
  const lib = dlopen(fullPath, ffiDefinition);
3643
3657
  nativeLib = lib.symbols;
3644
3658
  return nativeLib;
@@ -3781,11 +3795,11 @@ var devVendorPaths = null, getDevVendorPaths = () => devVendorPaths, setDevVendo
3781
3795
 
3782
3796
  // src/build/angularLinkerPlugin.ts
3783
3797
  import { existsSync as existsSync12, mkdirSync as mkdirSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync6 } from "fs";
3784
- import { dirname as dirname6, join as join10, relative as relative4, resolve as resolve10 } from "path";
3798
+ import { dirname as dirname6, join as join10, relative as relative4, resolve as resolve11 } from "path";
3785
3799
  import { createHash } from "crypto";
3786
3800
  var CACHE_DIR, angularLinkerPlugin;
3787
3801
  var init_angularLinkerPlugin = __esm(() => {
3788
- CACHE_DIR = resolve10(".absolutejs", "cache", "angular-linker");
3802
+ CACHE_DIR = resolve11(".absolutejs", "cache", "angular-linker");
3789
3803
  angularLinkerPlugin = {
3790
3804
  name: "angular-linker",
3791
3805
  setup(bld) {
@@ -3825,7 +3839,7 @@ var init_angularLinkerPlugin = __esm(() => {
3825
3839
  exists: existsSync12,
3826
3840
  readFile: readFileSync7,
3827
3841
  relative: relative4,
3828
- resolve: resolve10
3842
+ resolve: resolve11
3829
3843
  },
3830
3844
  linkerJitMode: false,
3831
3845
  logger: {
@@ -3859,14 +3873,14 @@ var init_angularLinkerPlugin = __esm(() => {
3859
3873
 
3860
3874
  // src/utils/cleanStaleOutputs.ts
3861
3875
  import { rm as rm2 } from "fs/promises";
3862
- import { resolve as resolve11 } from "path";
3876
+ import { resolve as resolve12 } from "path";
3863
3877
  var {Glob: Glob5 } = globalThis.Bun;
3864
3878
  var HASHED_FILE_PATTERN, cleanStaleOutputs = async (buildPath, currentOutputPaths) => {
3865
- const currentPaths = new Set(currentOutputPaths.map((path) => resolve11(path)));
3879
+ const currentPaths = new Set(currentOutputPaths.map((path) => resolve12(path)));
3866
3880
  const glob = new Glob5("**/*");
3867
3881
  const removals = [];
3868
3882
  for (const relative5 of glob.scanSync({ cwd: buildPath })) {
3869
- const absolute = resolve11(buildPath, relative5);
3883
+ const absolute = resolve12(buildPath, relative5);
3870
3884
  if (currentPaths.has(absolute))
3871
3885
  continue;
3872
3886
  if (!HASHED_FILE_PATTERN.test(relative5))
@@ -3927,10 +3941,10 @@ var commonAncestor = (paths, fallback) => {
3927
3941
  var init_commonAncestor = () => {};
3928
3942
 
3929
3943
  // src/utils/validateSafePath.ts
3930
- import { resolve as resolve12, relative as relative5 } from "path";
3944
+ import { resolve as resolve13, relative as relative5 } from "path";
3931
3945
  var validateSafePath = (targetPath, baseDirectory) => {
3932
- const absoluteBase = resolve12(baseDirectory);
3933
- const absoluteTarget = resolve12(baseDirectory, targetPath);
3946
+ const absoluteBase = resolve13(baseDirectory);
3947
+ const absoluteTarget = resolve13(baseDirectory, targetPath);
3934
3948
  const relativePath = normalizePath(relative5(absoluteBase, absoluteTarget));
3935
3949
  if (relativePath.startsWith("../") || relativePath === "..") {
3936
3950
  throw new Error(`Unsafe path: ${targetPath}`);
@@ -4084,7 +4098,7 @@ import {
4084
4098
  join as join12,
4085
4099
  basename as basename4,
4086
4100
  extname as extname5,
4087
- resolve as resolve13,
4101
+ resolve as resolve14,
4088
4102
  relative as relative6,
4089
4103
  sep as sep2
4090
4104
  } from "path";
@@ -4092,14 +4106,14 @@ import { env } from "process";
4092
4106
  var {write, file, Transpiler } = globalThis.Bun;
4093
4107
  var resolveDevClientDir2 = () => {
4094
4108
  const projectRoot = process.cwd();
4095
- const fromSource = resolve13(import.meta.dir, "../dev/client");
4109
+ const fromSource = resolve14(import.meta.dir, "../dev/client");
4096
4110
  if (existsSync13(fromSource) && fromSource.startsWith(projectRoot)) {
4097
4111
  return fromSource;
4098
4112
  }
4099
- const fromNodeModules = resolve13(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
4113
+ const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
4100
4114
  if (existsSync13(fromNodeModules))
4101
4115
  return fromNodeModules;
4102
- return resolve13(import.meta.dir, "./dev/client");
4116
+ return resolve14(import.meta.dir, "./dev/client");
4103
4117
  }, devClientDir2, hmrClientPath3, persistentCache, sourceHashCache, clearSvelteCompilerCache = () => {
4104
4118
  persistentCache.clear();
4105
4119
  sourceHashCache.clear();
@@ -4129,7 +4143,7 @@ var resolveDevClientDir2 = () => {
4129
4143
  }, resolveRelativeModule2 = async (spec, from) => {
4130
4144
  if (!spec.startsWith("."))
4131
4145
  return null;
4132
- const basePath = resolve13(dirname7(from), spec);
4146
+ const basePath = resolve14(dirname7(from), spec);
4133
4147
  const candidates = [
4134
4148
  basePath,
4135
4149
  `${basePath}.ts`,
@@ -4156,7 +4170,7 @@ var resolveDevClientDir2 = () => {
4156
4170
  const resolved = resolvePackageImport(spec);
4157
4171
  return resolved && /\.svelte(\.(?:ts|js))?$/.test(resolved) ? resolved : null;
4158
4172
  }
4159
- const basePath = resolve13(dirname7(from), spec);
4173
+ const basePath = resolve14(dirname7(from), spec);
4160
4174
  const explicit = /\.(svelte|svelte\.(?:ts|js))$/.test(basePath);
4161
4175
  if (!explicit) {
4162
4176
  const extensions = [".svelte", ".svelte.ts", ".svelte.js"];
@@ -4183,7 +4197,7 @@ var resolveDevClientDir2 = () => {
4183
4197
  client: toClient.startsWith(".") || toClient.startsWith("/") ? toClient : `./${toClient}`,
4184
4198
  server: toServer.startsWith(".") ? toServer : `./${toServer}`
4185
4199
  });
4186
- }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false) => {
4200
+ }, compileSvelte = async (entryPoints, svelteRoot, cache = new Map, isDev = false, stylePreprocessors) => {
4187
4201
  const { compile, compileModule, preprocess } = await import("svelte/compiler");
4188
4202
  const generatedDir = join12(svelteRoot, "generated");
4189
4203
  const clientDir = join12(generatedDir, "client");
@@ -4211,7 +4225,7 @@ var resolveDevClientDir2 = () => {
4211
4225
  const loweredServerSource = isModule ? loweredAwaitServerSource : lowerSvelteIslandSyntax(loweredAwaitServerSource.code, "server");
4212
4226
  const loweredClientSource = isModule ? loweredAwaitClientSource : lowerSvelteIslandSyntax(loweredAwaitClientSource.code, "client");
4213
4227
  const transformedByLowering = loweredAwaitServerSource.transformed || loweredAwaitClientSource.transformed || loweredServerSource.transformed || loweredClientSource.transformed;
4214
- const svelteStylePreprocessor = createSvelteStylePreprocessor();
4228
+ const svelteStylePreprocessor = createSvelteStylePreprocessor(stylePreprocessors);
4215
4229
  const preprocessedServer = isModule ? loweredServerSource.code : (await preprocess(loweredServerSource.code, svelteStylePreprocessor)).code;
4216
4230
  const preprocessedClient = isModule ? loweredClientSource.code : (await preprocess(loweredClientSource.code, svelteStylePreprocessor)).code;
4217
4231
  const transpiledServer = src.endsWith(".ts") || src.endsWith(".svelte.ts") ? transpiler2.transformSync(preprocessedServer) : preprocessedServer;
@@ -4436,18 +4450,18 @@ __export(exports_compileVue, {
4436
4450
  });
4437
4451
  import { existsSync as existsSync14 } from "fs";
4438
4452
  import { mkdir as mkdir3 } from "fs/promises";
4439
- import { basename as basename5, dirname as dirname8, join as join13, relative as relative7, resolve as resolve14 } from "path";
4453
+ import { basename as basename5, dirname as dirname8, join as join13, relative as relative7, resolve as resolve15 } from "path";
4440
4454
  var {file: file2, write: write2, Transpiler: Transpiler2 } = globalThis.Bun;
4441
4455
  var resolveDevClientDir3 = () => {
4442
4456
  const projectRoot = process.cwd();
4443
- const fromSource = resolve14(import.meta.dir, "../dev/client");
4457
+ const fromSource = resolve15(import.meta.dir, "../dev/client");
4444
4458
  if (existsSync14(fromSource) && fromSource.startsWith(projectRoot)) {
4445
4459
  return fromSource;
4446
4460
  }
4447
- const fromNodeModules = resolve14(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
4461
+ const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
4448
4462
  if (existsSync14(fromNodeModules))
4449
4463
  return fromNodeModules;
4450
- return resolve14(import.meta.dir, "./dev/client");
4464
+ return resolve15(import.meta.dir, "./dev/client");
4451
4465
  }, devClientDir3, hmrClientPath4, transpiler3, scriptCache, scriptSetupCache, templateCache, styleCache, persistentBuildCache, vueSourceHashCache, vueHmrMetadata, clearVueHmrCaches = () => {
4452
4466
  scriptCache.clear();
4453
4467
  scriptSetupCache.clear();
@@ -4509,7 +4523,7 @@ var resolveDevClientDir3 = () => {
4509
4523
  ].join(`
4510
4524
  `) : nonVueLines.join(`
4511
4525
  `);
4512
- }, compileVueFile = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler) => {
4526
+ }, compileVueFile = async (sourceFilePath, outputDirs, cacheMap, isEntryPoint, vueRootDir, compiler, stylePreprocessors) => {
4513
4527
  const cachedResult = cacheMap.get(sourceFilePath);
4514
4528
  if (cachedResult)
4515
4529
  return cachedResult;
@@ -4547,8 +4561,8 @@ var resolveDevClientDir3 = () => {
4547
4561
  const packageComponentPaths = Array.from(resolvedPackageVueImports.entries());
4548
4562
  const helperModulePaths = importPaths.filter((path) => path.startsWith(".") && !path.endsWith(".vue"));
4549
4563
  const childBuildResults = await Promise.all([
4550
- ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve14(dirname8(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler)),
4551
- ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler))
4564
+ ...childComponentPaths.map((relativeChildPath) => compileVueFile(resolve15(dirname8(sourceFilePath), relativeChildPath), outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors)),
4565
+ ...packageComponentPaths.map(([, absolutePath]) => compileVueFile(absolutePath, outputDirs, cacheMap, false, vueRootDir, compiler, stylePreprocessors))
4552
4566
  ]);
4553
4567
  const hasScript = descriptor.script || descriptor.scriptSetup;
4554
4568
  const compiledScript = hasScript ? compiler.compileScript(descriptor, {
@@ -4583,7 +4597,7 @@ var resolveDevClientDir3 = () => {
4583
4597
  filename: sourceFilePath,
4584
4598
  id: componentId,
4585
4599
  scoped: styleBlock.scoped,
4586
- source: styleBlock.lang ? await compileStyleSource(sourceFilePath, styleBlock.content, styleBlock.lang) : styleBlock.content,
4600
+ source: styleBlock.lang ? await compileStyleSource(sourceFilePath, styleBlock.content, styleBlock.lang, stylePreprocessors) : styleBlock.content,
4587
4601
  trim: true
4588
4602
  }).code));
4589
4603
  const allCss = [
@@ -4655,14 +4669,14 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
4655
4669
  hmrId,
4656
4670
  serverPath: serverOutputPath,
4657
4671
  tsHelperPaths: [
4658
- ...helperModulePaths.map((helper) => resolve14(dirname8(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
4672
+ ...helperModulePaths.map((helper) => resolve15(dirname8(sourceFilePath), helper.endsWith(".ts") ? helper : `${helper}.ts`)),
4659
4673
  ...childBuildResults.flatMap((child) => child.tsHelperPaths)
4660
4674
  ]
4661
4675
  };
4662
4676
  cacheMap.set(sourceFilePath, result);
4663
4677
  persistentBuildCache.set(sourceFilePath, result);
4664
4678
  return result;
4665
- }, compileVue = async (entryPoints, vueRootDir, isDev = false) => {
4679
+ }, compileVue = async (entryPoints, vueRootDir, isDev = false, stylePreprocessors) => {
4666
4680
  const compiler = await import("@vue/compiler-sfc");
4667
4681
  const generatedDir = join13(vueRootDir, "generated");
4668
4682
  const clientOutputDir = join13(generatedDir, "client");
@@ -4678,11 +4692,11 @@ if (typeof __VUE_HMR_RUNTIME__ !== 'undefined') {
4678
4692
  const buildCache = new Map;
4679
4693
  const allTsHelperPaths = new Set;
4680
4694
  const compiledPages = await Promise.all(entryPoints.map(async (entryPath) => {
4681
- const result = await compileVueFile(resolve14(entryPath), {
4695
+ const result = await compileVueFile(resolve15(entryPath), {
4682
4696
  client: clientOutputDir,
4683
4697
  css: cssOutputDir,
4684
4698
  server: serverOutputDir
4685
- }, buildCache, true, vueRootDir, compiler);
4699
+ }, buildCache, true, vueRootDir, compiler, stylePreprocessors);
4686
4700
  result.tsHelperPaths.forEach((path) => allTsHelperPaths.add(path));
4687
4701
  const entryBaseName = basename5(entryPath, ".vue");
4688
4702
  const indexOutputFile = join13(indexOutputDir, `${entryBaseName}.js`);
@@ -5316,7 +5330,7 @@ __export(exports_compileAngular, {
5316
5330
  compileAngular: () => compileAngular
5317
5331
  });
5318
5332
  import { existsSync as existsSync15, readFileSync as readFileSync8, promises as fs } from "fs";
5319
- import { join as join14, basename as basename6, sep as sep3, dirname as dirname9, resolve as resolve15, relative as relative8 } from "path";
5333
+ import { join as join14, basename as basename6, sep as sep3, dirname as dirname9, resolve as resolve16, relative as relative8 } from "path";
5320
5334
  import ts2 from "typescript";
5321
5335
  import { createHash as createHash2 } from "crypto";
5322
5336
  var computeConfigHash = () => {
@@ -5328,14 +5342,14 @@ var computeConfigHash = () => {
5328
5342
  }
5329
5343
  }, resolveDevClientDir4 = () => {
5330
5344
  const projectRoot = process.cwd();
5331
- const fromSource = resolve15(import.meta.dir, "../dev/client");
5345
+ const fromSource = resolve16(import.meta.dir, "../dev/client");
5332
5346
  if (existsSync15(fromSource) && fromSource.startsWith(projectRoot)) {
5333
5347
  return fromSource;
5334
5348
  }
5335
- const fromNodeModules = resolve15(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
5349
+ const fromNodeModules = resolve16(projectRoot, "node_modules/@absolutejs/absolute/dist/dev/client");
5336
5350
  if (existsSync15(fromNodeModules))
5337
5351
  return fromNodeModules;
5338
- return resolve15(import.meta.dir, "./dev/client");
5352
+ return resolve16(import.meta.dir, "./dev/client");
5339
5353
  }, devClientDir4, hmrClientPath5, hmrRuntimePath, injectHMRRegistration = (content, sourceId) => {
5340
5354
  const componentClassRegex = /(?:export\s+)?class\s+(\w+Component)\s/g;
5341
5355
  const componentNames = [];
@@ -5401,7 +5415,7 @@ ${registrations}
5401
5415
  }, resolveLocalTsImport = (fromFile, specifier) => {
5402
5416
  if (!isRelativeModuleSpecifier(specifier))
5403
5417
  return null;
5404
- const basePath = resolve15(dirname9(fromFile), specifier);
5418
+ const basePath = resolve16(dirname9(fromFile), specifier);
5405
5419
  const candidates = /\.[cm]?[tj]sx?$/.test(basePath) ? [basePath] : [
5406
5420
  `${basePath}.ts`,
5407
5421
  `${basePath}.tsx`,
@@ -5412,24 +5426,24 @@ ${registrations}
5412
5426
  join14(basePath, "index.mts"),
5413
5427
  join14(basePath, "index.cts")
5414
5428
  ];
5415
- return candidates.map((candidate) => resolve15(candidate)).find((candidate) => existsSync15(candidate) && !candidate.endsWith(".d.ts")) ?? null;
5429
+ return candidates.map((candidate) => resolve16(candidate)).find((candidate) => existsSync15(candidate) && !candidate.endsWith(".d.ts")) ?? null;
5416
5430
  }, readFileForAotTransform = async (fileName, readFile4) => {
5417
5431
  const hostSource = readFile4?.(fileName);
5418
5432
  if (typeof hostSource === "string")
5419
5433
  return hostSource;
5420
5434
  return fs.readFile(fileName, "utf-8");
5421
- }, precomputeAotResourceTransforms = async (inputPath, readFile4) => {
5435
+ }, precomputeAotResourceTransforms = async (inputPath, readFile4, stylePreprocessors) => {
5422
5436
  const transformedSources = new Map;
5423
5437
  const visited = new Set;
5424
5438
  const transformFile = async (filePath) => {
5425
- const resolvedPath = resolve15(filePath);
5439
+ const resolvedPath = resolve16(filePath);
5426
5440
  if (visited.has(resolvedPath))
5427
5441
  return;
5428
5442
  visited.add(resolvedPath);
5429
5443
  if (!existsSync15(resolvedPath) || resolvedPath.endsWith(".d.ts"))
5430
5444
  return;
5431
5445
  const source = await readFileForAotTransform(resolvedPath, readFile4);
5432
- const transformed = await inlineResources(source, dirname9(resolvedPath));
5446
+ const transformed = await inlineResources(source, dirname9(resolvedPath), stylePreprocessors);
5433
5447
  transformedSources.set(resolvedPath, transformed.source);
5434
5448
  const imports = extractLocalImportSpecifiers(source, resolvedPath);
5435
5449
  await Promise.all(imports.map(async (specifier) => {
@@ -5440,7 +5454,7 @@ ${registrations}
5440
5454
  };
5441
5455
  await transformFile(inputPath);
5442
5456
  return transformedSources;
5443
- }, compileAngularFile = async (inputPath, outDir) => {
5457
+ }, compileAngularFile = async (inputPath, outDir, stylePreprocessors) => {
5444
5458
  const islandMetadataExports = buildIslandMetadataExports(readFileSync8(inputPath, "utf-8"));
5445
5459
  const { readConfiguration, performCompilation, EmitFlags } = await import("@angular/compiler-cli");
5446
5460
  const configHash = computeConfigHash();
@@ -5456,7 +5470,7 @@ ${registrations}
5456
5470
  } else {
5457
5471
  const tsPath = __require.resolve("typescript");
5458
5472
  const tsRootDir = dirname9(tsPath);
5459
- tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve15(tsRootDir, "lib");
5473
+ tsLibDir = tsRootDir.endsWith("lib") ? tsRootDir : resolve16(tsRootDir, "lib");
5460
5474
  const config = readConfiguration("./tsconfig.json");
5461
5475
  options = {
5462
5476
  emitDecoratorMetadata: true,
@@ -5503,13 +5517,13 @@ ${registrations}
5503
5517
  };
5504
5518
  }
5505
5519
  const emitted = {};
5506
- const resolvedOutDir = resolve15(outDir);
5520
+ const resolvedOutDir = resolve16(outDir);
5507
5521
  host.writeFile = (fileName, text) => {
5508
5522
  const relativePath = resolveRelativePath(fileName, resolvedOutDir, outDir);
5509
5523
  emitted[relativePath] = text;
5510
5524
  };
5511
5525
  const originalReadFile = host.readFile;
5512
- const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host));
5526
+ const aotTransformedSources = await precomputeAotResourceTransforms(inputPath, originalReadFile?.bind(host), stylePreprocessors);
5513
5527
  host.readFile = (fileName) => {
5514
5528
  const source = originalReadFile ? originalReadFile.call(host, fileName) : undefined;
5515
5529
  if (typeof source !== "string")
@@ -5517,7 +5531,7 @@ ${registrations}
5517
5531
  if (!fileName.endsWith(".ts") || fileName.endsWith(".d.ts")) {
5518
5532
  return source;
5519
5533
  }
5520
- const resolvedPath = resolve15(fileName);
5534
+ const resolvedPath = resolve16(fileName);
5521
5535
  return aotTransformedSources.get(resolvedPath) ?? source;
5522
5536
  };
5523
5537
  const originalGetSourceFileForCompile = host.getSourceFile;
@@ -5562,7 +5576,7 @@ ${registrations}
5562
5576
  await Promise.all(entries.map(({ target, content }) => fs.writeFile(target, content, "utf-8")));
5563
5577
  return entries.map(({ target }) => target);
5564
5578
  }, jitContentCache, wrapperOutputCache, escapeTemplateContent = (content) => content.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$\{/g, "\\${"), resolveAngularDeferImportSpecifier = () => {
5565
- const sourceEntry = resolve15(import.meta.dir, "../angular/components/index.ts");
5579
+ const sourceEntry = resolve16(import.meta.dir, "../angular/components/index.ts");
5566
5580
  if (existsSync15(sourceEntry)) {
5567
5581
  return sourceEntry.replace(/\\/g, "/");
5568
5582
  }
@@ -5690,10 +5704,10 @@ ${slot.resolvedBindings.map((binding) => ` "${binding.key}": this.__absoluteDef
5690
5704
  return rewritten.replace(/export(?:\s+default)?\s+class\s+([A-Za-z_$][\w$]*)\s*{/, (match) => `${match}
5691
5705
  ${fields}
5692
5706
  `);
5693
- }, readAndEscapeFile = async (filePath) => {
5707
+ }, readAndEscapeFile = async (filePath, stylePreprocessors) => {
5694
5708
  if (!existsSync15(filePath))
5695
5709
  return null;
5696
- const content = await compileStyleFileIfNeeded(filePath);
5710
+ const content = await compileStyleFileIfNeeded(filePath, stylePreprocessors);
5697
5711
  return escapeTemplateContent(content);
5698
5712
  }, inlineTemplateAndLowerDefer = async (source, fileDir) => {
5699
5713
  const templateUrlMatch = source.match(/templateUrl\s*:\s*['"]([^'"]+)['"]/);
@@ -5757,7 +5771,7 @@ ${fields}
5757
5771
  deferSlots: lowered.slots,
5758
5772
  source: injectDeferSlotFields(replacedSource, lowered.slots, resolveAngularDeferImportSpecifier())
5759
5773
  };
5760
- }, inlineStyleUrls = async (source, fileDir) => {
5774
+ }, inlineStyleUrls = async (source, fileDir, stylePreprocessors) => {
5761
5775
  const styleUrlsMatch = source.match(/styleUrls\s*:\s*\[([^\]]+)\]/);
5762
5776
  if (!styleUrlsMatch?.[1])
5763
5777
  return source;
@@ -5766,35 +5780,35 @@ ${fields}
5766
5780
  return source;
5767
5781
  const stylePromises = urlMatches.map((urlMatch) => {
5768
5782
  const styleUrl = urlMatch.replace(/['"]/g, "");
5769
- return readAndEscapeFile(join14(fileDir, styleUrl));
5783
+ return readAndEscapeFile(join14(fileDir, styleUrl), stylePreprocessors);
5770
5784
  });
5771
5785
  const results = await Promise.all(stylePromises);
5772
5786
  const inlinedStyles = results.filter(Boolean).map((escaped) => `\`${escaped}\``);
5773
5787
  if (inlinedStyles.length === 0)
5774
5788
  return source;
5775
5789
  return source.replace(/styleUrls\s*:\s*\[[^\]]+\]/, `styles: [${inlinedStyles.join(", ")}]`);
5776
- }, inlineSingleStyleUrl = async (source, fileDir) => {
5790
+ }, inlineSingleStyleUrl = async (source, fileDir, stylePreprocessors) => {
5777
5791
  const styleUrlMatch = source.match(/styleUrl\s*:\s*['"]([^'"]+)['"]/);
5778
5792
  if (!styleUrlMatch?.[1])
5779
5793
  return source;
5780
- const escaped = await readAndEscapeFile(join14(fileDir, styleUrlMatch[1]));
5794
+ const escaped = await readAndEscapeFile(join14(fileDir, styleUrlMatch[1]), stylePreprocessors);
5781
5795
  if (!escaped)
5782
5796
  return source;
5783
5797
  return source.replace(/styleUrl\s*:\s*['"][^'"]+['"]/, `styles: [\`${escaped}\`]`);
5784
- }, inlineResources = async (source, fileDir) => {
5798
+ }, inlineResources = async (source, fileDir, stylePreprocessors) => {
5785
5799
  const inlinedTemplate = await inlineTemplateAndLowerDefer(source, fileDir);
5786
5800
  let result = inlinedTemplate.source;
5787
- result = await inlineStyleUrls(result, fileDir);
5788
- result = await inlineSingleStyleUrl(result, fileDir);
5801
+ result = await inlineStyleUrls(result, fileDir, stylePreprocessors);
5802
+ result = await inlineSingleStyleUrl(result, fileDir, stylePreprocessors);
5789
5803
  return {
5790
5804
  deferSlots: inlinedTemplate.deferSlots,
5791
5805
  source: result
5792
5806
  };
5793
- }, compileAngularFileJIT = async (inputPath, outDir, rootDir) => {
5794
- const entryPath = resolve15(inputPath);
5807
+ }, compileAngularFileJIT = async (inputPath, outDir, rootDir, stylePreprocessors) => {
5808
+ const entryPath = resolve16(inputPath);
5795
5809
  const allOutputs = [];
5796
5810
  const visited = new Set;
5797
- const baseDir = resolve15(rootDir ?? process.cwd());
5811
+ const baseDir = resolve16(rootDir ?? process.cwd());
5798
5812
  const angularTranspiler = new Bun.Transpiler({
5799
5813
  loader: "ts",
5800
5814
  tsconfig: JSON.stringify({
@@ -5831,13 +5845,13 @@ ${fields}
5831
5845
  return `${prefix}${dots}`;
5832
5846
  return `${prefix}../${dots}`;
5833
5847
  });
5834
- if (resolve15(actualPath) === entryPath) {
5848
+ if (resolve16(actualPath) === entryPath) {
5835
5849
  processedContent += buildIslandMetadataExports(sourceCode);
5836
5850
  }
5837
5851
  return processedContent;
5838
5852
  };
5839
5853
  const transpileFile = async (filePath) => {
5840
- const resolved = resolve15(filePath);
5854
+ const resolved = resolve16(filePath);
5841
5855
  if (visited.has(resolved))
5842
5856
  return;
5843
5857
  visited.add(resolved);
@@ -5847,7 +5861,7 @@ ${fields}
5847
5861
  if (!existsSync15(actualPath))
5848
5862
  return;
5849
5863
  let sourceCode = await fs.readFile(actualPath, "utf-8");
5850
- const inlined = await inlineResources(sourceCode, dirname9(actualPath));
5864
+ const inlined = await inlineResources(sourceCode, dirname9(actualPath), stylePreprocessors);
5851
5865
  sourceCode = inlineTemplateAndLowerDeferSync(inlined.source, dirname9(actualPath)).source;
5852
5866
  const inputDir = dirname9(actualPath);
5853
5867
  const relativeDir = inputDir.startsWith(baseDir) ? inputDir.substring(baseDir.length + 1) : inputDir;
@@ -5879,13 +5893,13 @@ ${fields}
5879
5893
  }
5880
5894
  const inputDirForResolve = dirname9(actualPath);
5881
5895
  await Promise.all(localImports.map((imp) => {
5882
- const importPath = resolve15(inputDirForResolve, imp);
5896
+ const importPath = resolve16(inputDirForResolve, imp);
5883
5897
  return transpileFile(importPath);
5884
5898
  }));
5885
5899
  };
5886
5900
  await transpileFile(inputPath);
5887
5901
  return allOutputs;
5888
- }, compileAngular = async (entryPoints, outRoot, hmr = false) => {
5902
+ }, compileAngular = async (entryPoints, outRoot, hmr = false, stylePreprocessors) => {
5889
5903
  const compiledParent = join14(outRoot, "generated");
5890
5904
  if (entryPoints.length === 0) {
5891
5905
  const emptyPaths = [];
@@ -5895,9 +5909,9 @@ ${fields}
5895
5909
  const indexesDir = join14(compiledParent, "indexes");
5896
5910
  await fs.mkdir(indexesDir, { recursive: true });
5897
5911
  const compileTasks = entryPoints.map(async (entry) => {
5898
- const resolvedEntry = resolve15(entry);
5912
+ const resolvedEntry = resolve16(entry);
5899
5913
  const relativeEntry = relative8(outRoot, resolvedEntry).replace(/\.[tj]s$/, ".js");
5900
- const compileEntry = () => hmr ? compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot) : compileAngularFile(resolvedEntry, compiledRoot);
5914
+ const compileEntry = () => hmr ? compileAngularFileJIT(resolvedEntry, compiledRoot, outRoot, stylePreprocessors) : compileAngularFile(resolvedEntry, compiledRoot, stylePreprocessors);
5901
5915
  let outputs = await compileEntry();
5902
5916
  const fileBase = basename6(resolvedEntry).replace(/\.[tj]s$/, "");
5903
5917
  const jsName = `${fileBase}.js`;
@@ -5905,10 +5919,10 @@ ${fields}
5905
5919
  join14(compiledRoot, relativeEntry),
5906
5920
  join14(compiledRoot, "pages", jsName),
5907
5921
  join14(compiledRoot, jsName)
5908
- ].map((file3) => resolve15(file3));
5922
+ ].map((file3) => resolve16(file3));
5909
5923
  const resolveRawServerFile = (candidatePaths) => {
5910
5924
  const normalizedCandidates = [
5911
- ...candidatePaths.map((file3) => resolve15(file3)),
5925
+ ...candidatePaths.map((file3) => resolve16(file3)),
5912
5926
  ...compiledFallbackPaths
5913
5927
  ];
5914
5928
  let candidate = normalizedCandidates.find((file3) => existsSync15(file3) && file3.endsWith(`${sep3}pages${sep3}${jsName}`));
@@ -6139,24 +6153,24 @@ __export(exports_buildReactVendor, {
6139
6153
  buildReactVendor: () => buildReactVendor
6140
6154
  });
6141
6155
  import { existsSync as existsSync16, mkdirSync as mkdirSync6 } from "fs";
6142
- import { join as join15, resolve as resolve16 } from "path";
6156
+ import { join as join15, resolve as resolve17 } from "path";
6143
6157
  import { rm as rm4 } from "fs/promises";
6144
6158
  var {build: bunBuild2 } = globalThis.Bun;
6145
6159
  var resolveJsxDevRuntimeCompatPath = () => {
6146
6160
  const candidates = [
6147
- resolve16(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
6148
- resolve16(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
6149
- resolve16(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
6150
- resolve16(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
6151
- resolve16(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
6152
- resolve16(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
6161
+ resolve17(import.meta.dir, "react", "jsxDevRuntimeCompat.js"),
6162
+ resolve17(import.meta.dir, "src", "react", "jsxDevRuntimeCompat.ts"),
6163
+ resolve17(import.meta.dir, "..", "react", "jsxDevRuntimeCompat.js"),
6164
+ resolve17(import.meta.dir, "..", "src", "react", "jsxDevRuntimeCompat.ts"),
6165
+ resolve17(import.meta.dir, "..", "..", "dist", "react", "jsxDevRuntimeCompat.js"),
6166
+ resolve17(import.meta.dir, "..", "..", "src", "react", "jsxDevRuntimeCompat.ts")
6153
6167
  ];
6154
6168
  for (const candidate of candidates) {
6155
6169
  if (existsSync16(candidate)) {
6156
6170
  return candidate.replace(/\\/g, "/");
6157
6171
  }
6158
6172
  }
6159
- return (candidates[0] ?? resolve16(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
6173
+ return (candidates[0] ?? resolve17(import.meta.dir, "react", "jsxDevRuntimeCompat.js")).replace(/\\/g, "/");
6160
6174
  }, jsxDevRuntimeCompatPath, reactSpecifiers, isResolvable = (specifier) => {
6161
6175
  try {
6162
6176
  Bun.resolveSync(specifier, process.cwd());
@@ -6462,7 +6476,7 @@ import {
6462
6476
  statSync,
6463
6477
  writeFileSync as writeFileSync7
6464
6478
  } from "fs";
6465
- import { basename as basename7, dirname as dirname10, join as join19, relative as relative9, resolve as resolve17 } from "path";
6479
+ import { basename as basename7, dirname as dirname10, join as join19, relative as relative9, resolve as resolve18 } from "path";
6466
6480
  import { cwd, env as env2, exit } from "process";
6467
6481
  var {build: bunBuild6, Glob: Glob6 } = globalThis.Bun;
6468
6482
  var isDev, collectConventionSourceFiles = (entry) => {
@@ -6550,8 +6564,8 @@ var isDev, collectConventionSourceFiles = (entry) => {
6550
6564
  }
6551
6565
  }, resolveAbsoluteVersion = async () => {
6552
6566
  const candidates = [
6553
- resolve17(import.meta.dir, "..", "..", "package.json"),
6554
- resolve17(import.meta.dir, "..", "package.json")
6567
+ resolve18(import.meta.dir, "..", "..", "package.json"),
6568
+ resolve18(import.meta.dir, "..", "package.json")
6555
6569
  ];
6556
6570
  for (const candidate of candidates) {
6557
6571
  const pkg = await tryReadPackageJson(candidate);
@@ -6563,7 +6577,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6563
6577
  return;
6564
6578
  }
6565
6579
  }, SKIP_DIRS, addWorkerPathIfExists = (file3, relPath, workerPaths) => {
6566
- const absPath = resolve17(file3, "..", relPath);
6580
+ const absPath = resolve18(file3, "..", relPath);
6567
6581
  try {
6568
6582
  statSync(absPath);
6569
6583
  workerPaths.add(absPath);
@@ -6627,7 +6641,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6627
6641
  return;
6628
6642
  }
6629
6643
  const indexFiles = readDir(reactIndexesPath).filter((file3) => file3.endsWith(".tsx"));
6630
- const pagesRel = relative9(process.cwd(), resolve17(reactPagesPath)).replace(/\\/g, "/");
6644
+ const pagesRel = relative9(process.cwd(), resolve18(reactPagesPath)).replace(/\\/g, "/");
6631
6645
  for (const file3 of indexFiles) {
6632
6646
  let content = readFileSync9(join19(reactIndexesPath, file3), "utf-8");
6633
6647
  content = content.replace(/from\s*['"]([^'"]*\/pages\/([^'"]+))['"]/g, (_match, _fullPath, componentName) => `from '/@src/${pagesRel}/${componentName}'`);
@@ -6635,27 +6649,27 @@ var isDev, collectConventionSourceFiles = (entry) => {
6635
6649
  }
6636
6650
  }, copySvelteDevIndexes = (svelteDir, sveltePagesPath, svelteEntries, devIndexDir) => {
6637
6651
  const svelteIndexDir = join19(svelteDir, "generated", "indexes");
6638
- const sveltePageEntries = svelteEntries.filter((file3) => resolve17(file3).startsWith(resolve17(sveltePagesPath)));
6652
+ const sveltePageEntries = svelteEntries.filter((file3) => resolve18(file3).startsWith(resolve18(sveltePagesPath)));
6639
6653
  for (const entry of sveltePageEntries) {
6640
6654
  const name = basename7(entry).replace(/\.svelte(\.(ts|js))?$/, "");
6641
6655
  const indexFile = join19(svelteIndexDir, "pages", `${name}.js`);
6642
6656
  if (!existsSync17(indexFile))
6643
6657
  continue;
6644
6658
  let content = readFileSync9(indexFile, "utf-8");
6645
- const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
6659
+ const srcRel = relative9(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
6646
6660
  content = content.replace(/import\s+Component\s+from\s+['"]([^'"]+)['"]/, `import Component from "/@src/${srcRel}"`);
6647
6661
  writeFileSync7(join19(devIndexDir, `${name}.svelte.js`), content);
6648
6662
  }
6649
6663
  }, copyVueDevIndexes = (vueDir, vuePagesPath, vueEntries, devIndexDir) => {
6650
6664
  const vueIndexDir = join19(vueDir, "generated", "indexes");
6651
- const vuePageEntries = vueEntries.filter((file3) => resolve17(file3).startsWith(resolve17(vuePagesPath)));
6665
+ const vuePageEntries = vueEntries.filter((file3) => resolve18(file3).startsWith(resolve18(vuePagesPath)));
6652
6666
  for (const entry of vuePageEntries) {
6653
6667
  const name = basename7(entry, ".vue");
6654
6668
  const indexFile = join19(vueIndexDir, `${name}.js`);
6655
6669
  if (!existsSync17(indexFile))
6656
6670
  continue;
6657
6671
  let content = readFileSync9(indexFile, "utf-8");
6658
- const srcRel = relative9(process.cwd(), resolve17(entry)).replace(/\\/g, "/");
6672
+ const srcRel = relative9(process.cwd(), resolve18(entry)).replace(/\\/g, "/");
6659
6673
  content = content.replace(/import\s+Comp\s+from\s+['"]([^'"]+)['"]/, `import Comp from "/@src/${srcRel}"`);
6660
6674
  writeFileSync7(join19(devIndexDir, `${name}.vue.js`), content);
6661
6675
  }
@@ -6668,7 +6682,7 @@ var isDev, collectConventionSourceFiles = (entry) => {
6668
6682
  const last = allComments[allComments.length - 1];
6669
6683
  if (!last?.[1])
6670
6684
  return JSON.stringify(outputPath);
6671
- const srcPath = resolve17(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
6685
+ const srcPath = resolve18(projectRoot, last[1].replace("/client/", "/").replace(/\.js$/, ".ts"));
6672
6686
  return JSON.stringify(srcPath);
6673
6687
  }, QUOTE_CHARS, OPEN_BRACES, CLOSE_BRACES, findFunctionExpressionEnd = (content, startPos) => {
6674
6688
  let depth = 0;
@@ -6780,6 +6794,7 @@ ${content.slice(firstUseIdx)}`;
6780
6794
  svelteDirectory,
6781
6795
  vueDirectory,
6782
6796
  stylesConfig,
6797
+ stylePreprocessors,
6783
6798
  tailwind,
6784
6799
  options,
6785
6800
  incrementalFiles,
@@ -6789,6 +6804,7 @@ ${content.slice(firstUseIdx)}`;
6789
6804
  const projectRoot = cwd();
6790
6805
  await resolveAbsoluteVersion();
6791
6806
  const isIncremental = incrementalFiles && incrementalFiles.length > 0;
6807
+ const stylePreprocessorPlugin2 = createStylePreprocessorPlugin(stylePreprocessors);
6792
6808
  const normalizedIncrementalFiles = incrementalFiles?.map(normalizePath);
6793
6809
  const throwOnError = options?.throwOnError === true;
6794
6810
  const hmr = options?.injectHMR === true;
@@ -6877,13 +6893,13 @@ ${content.slice(firstUseIdx)}`;
6877
6893
  const filterToIncrementalEntries = (entryPoints, mapToSource) => {
6878
6894
  if (!isIncremental || !incrementalFiles)
6879
6895
  return entryPoints;
6880
- const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve17(f)));
6896
+ const normalizedIncremental = new Set(incrementalFiles.map((f) => resolve18(f)));
6881
6897
  const matchingEntries = [];
6882
6898
  for (const entry of entryPoints) {
6883
6899
  const sourceFile = mapToSource(entry);
6884
6900
  if (!sourceFile)
6885
6901
  continue;
6886
- if (!normalizedIncremental.has(resolve17(sourceFile)))
6902
+ if (!normalizedIncremental.has(resolve18(sourceFile)))
6887
6903
  continue;
6888
6904
  matchingEntries.push(entry);
6889
6905
  }
@@ -6952,7 +6968,7 @@ ${content.slice(firstUseIdx)}`;
6952
6968
  }
6953
6969
  const shouldIncludeHtmlAssets = !isIncremental || normalizedIncrementalFiles?.some((f) => f.includes("/html/") && (f.endsWith(".html") || isStylePath(f)));
6954
6970
  const reactEntries = isIncremental && reactIndexesPath && reactPagesPath ? filterToIncrementalEntries(allReactEntries, (entry) => {
6955
- if (entry.startsWith(resolve17(reactIndexesPath))) {
6971
+ if (entry.startsWith(resolve18(reactIndexesPath))) {
6956
6972
  const pageName = basename7(entry, ".tsx");
6957
6973
  return join19(reactPagesPath, `${pageName}.tsx`);
6958
6974
  }
@@ -6984,28 +7000,28 @@ ${content.slice(firstUseIdx)}`;
6984
7000
  { vueClientPaths: islandVueClientPaths },
6985
7001
  { clientPaths: islandAngularClientPaths }
6986
7002
  ] = await Promise.all([
6987
- shouldCompileSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr)) : {
7003
+ shouldCompileSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteEntries, svelteDir, new Map, hmr, stylePreprocessors)) : {
6988
7004
  svelteClientPaths: [...emptyStringArray],
6989
7005
  svelteIndexPaths: [...emptyStringArray],
6990
7006
  svelteServerPaths: [...emptyStringArray]
6991
7007
  },
6992
- shouldCompileVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr)) : {
7008
+ shouldCompileVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueEntries, vueDir, hmr, stylePreprocessors)) : {
6993
7009
  vueClientPaths: [...emptyStringArray],
6994
7010
  vueCssPaths: [...emptyStringArray],
6995
7011
  vueIndexPaths: [...emptyStringArray],
6996
7012
  vueServerPaths: [...emptyStringArray]
6997
7013
  },
6998
- shouldCompileAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr)) : {
7014
+ shouldCompileAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(angularEntries, angularDir, hmr, stylePreprocessors)) : {
6999
7015
  clientPaths: [...emptyStringArray],
7000
7016
  serverPaths: [...emptyStringArray]
7001
7017
  },
7002
- shouldCompileIslandSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr)) : {
7018
+ shouldCompileIslandSvelte ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(islandSvelteSources, svelteDir, new Map, hmr, stylePreprocessors)) : {
7003
7019
  svelteClientPaths: [...emptyStringArray]
7004
7020
  },
7005
- shouldCompileIslandVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr)) : {
7021
+ shouldCompileIslandVue ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(islandVueSources, vueDir, hmr, stylePreprocessors)) : {
7006
7022
  vueClientPaths: [...emptyStringArray]
7007
7023
  },
7008
- shouldCompileIslandAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr)) : {
7024
+ shouldCompileIslandAngular ? Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular)).then((mod) => mod.compileAngular(islandAngularSources, angularDir, hmr, stylePreprocessors)) : {
7009
7025
  clientPaths: [...emptyStringArray]
7010
7026
  }
7011
7027
  ]);
@@ -7015,7 +7031,7 @@ ${content.slice(firstUseIdx)}`;
7015
7031
  const clientPath = islandSvelteClientPaths[idx];
7016
7032
  if (!sourcePath || !clientPath)
7017
7033
  continue;
7018
- islandSvelteClientPathMap.set(resolve17(sourcePath), clientPath);
7034
+ islandSvelteClientPathMap.set(resolve18(sourcePath), clientPath);
7019
7035
  }
7020
7036
  const islandVueClientPathMap = new Map;
7021
7037
  for (let idx = 0;idx < islandVueSources.length; idx++) {
@@ -7023,7 +7039,7 @@ ${content.slice(firstUseIdx)}`;
7023
7039
  const clientPath = islandVueClientPaths[idx];
7024
7040
  if (!sourcePath || !clientPath)
7025
7041
  continue;
7026
- islandVueClientPathMap.set(resolve17(sourcePath), clientPath);
7042
+ islandVueClientPathMap.set(resolve18(sourcePath), clientPath);
7027
7043
  }
7028
7044
  const islandAngularClientPathMap = new Map;
7029
7045
  for (let idx = 0;idx < islandAngularSources.length; idx++) {
@@ -7031,14 +7047,14 @@ ${content.slice(firstUseIdx)}`;
7031
7047
  const clientPath = islandAngularClientPaths[idx];
7032
7048
  if (!sourcePath || !clientPath)
7033
7049
  continue;
7034
- islandAngularClientPathMap.set(resolve17(sourcePath), clientPath);
7050
+ islandAngularClientPathMap.set(resolve18(sourcePath), clientPath);
7035
7051
  }
7036
7052
  const svelteConventionSources = collectConventionSourceFiles(conventionsMap.svelte);
7037
7053
  const vueConventionSources = collectConventionSourceFiles(conventionsMap.vue);
7038
7054
  if (svelteConventionSources.length > 0 || vueConventionSources.length > 0) {
7039
7055
  const [svelteConvResult, vueConvResult] = await Promise.all([
7040
- svelteConventionSources.length > 0 && svelteDir ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false)) : { svelteServerPaths: emptyStringArray },
7041
- vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false)) : { vueServerPaths: emptyStringArray }
7056
+ svelteConventionSources.length > 0 && svelteDir ? Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte)).then((mod) => mod.compileSvelte(svelteConventionSources, svelteDir, new Map, false, stylePreprocessors)) : { svelteServerPaths: emptyStringArray },
7057
+ vueConventionSources.length > 0 && vueDir ? Promise.resolve().then(() => (init_compileVue(), exports_compileVue)).then((mod) => mod.compileVue(vueConventionSources, vueDir, false, stylePreprocessors)) : { vueServerPaths: emptyStringArray }
7042
7058
  ]);
7043
7059
  const copyConventionFiles = (framework, sources, compiledPaths) => {
7044
7060
  const destDir = join19(buildPath, "conventions", framework);
@@ -7174,7 +7190,7 @@ ${content.slice(firstUseIdx)}`;
7174
7190
  naming: `[dir]/[name].[hash].[ext]`,
7175
7191
  outdir: buildPath,
7176
7192
  ...hmr ? { jsx: { development: true }, reactFastRefresh: true } : {},
7177
- plugins: [stylePreprocessorPlugin],
7193
+ plugins: [stylePreprocessorPlugin2],
7178
7194
  root: clientRoot,
7179
7195
  splitting: true,
7180
7196
  target: "browser",
@@ -7232,7 +7248,7 @@ ${content.slice(firstUseIdx)}`;
7232
7248
  format: "esm",
7233
7249
  naming: `[dir]/[name].[hash].[ext]`,
7234
7250
  outdir: serverOutDir,
7235
- plugins: [stylePreprocessorPlugin],
7251
+ plugins: [stylePreprocessorPlugin2],
7236
7252
  root: serverRoot,
7237
7253
  target: "bun",
7238
7254
  throw: false,
@@ -7248,7 +7264,7 @@ ${content.slice(firstUseIdx)}`;
7248
7264
  naming: `[dir]/[name].[hash].[ext]`,
7249
7265
  outdir: buildPath,
7250
7266
  plugins: [
7251
- stylePreprocessorPlugin,
7267
+ stylePreprocessorPlugin2,
7252
7268
  ...angularDir && !isDev ? [angularLinkerPlugin] : [],
7253
7269
  ...htmlScriptPlugin ? [htmlScriptPlugin] : []
7254
7270
  ],
@@ -7267,7 +7283,7 @@ ${content.slice(firstUseIdx)}`;
7267
7283
  naming: `[dir]/[name].[hash].[ext]`,
7268
7284
  outdir: buildPath,
7269
7285
  plugins: [
7270
- stylePreprocessorPlugin,
7286
+ stylePreprocessorPlugin2,
7271
7287
  ...angularDir && !isDev ? [angularLinkerPlugin] : []
7272
7288
  ],
7273
7289
  root: islandEntryResult.generatedRoot,
@@ -7282,7 +7298,7 @@ ${content.slice(firstUseIdx)}`;
7282
7298
  outdir: stylesDir ? join19(buildPath, basename7(stylesDir)) : buildPath,
7283
7299
  root: stylesDir || clientRoot,
7284
7300
  target: "browser",
7285
- plugins: [stylePreprocessorPlugin],
7301
+ plugins: [stylePreprocessorPlugin2],
7286
7302
  throw: false
7287
7303
  }) : undefined,
7288
7304
  vueCssPaths.length > 0 ? bunBuild6({
@@ -7573,7 +7589,7 @@ var init_build = __esm(() => {
7573
7589
  // src/dev/dependencyGraph.ts
7574
7590
  import { existsSync as existsSync18, readFileSync as readFileSync10 } from "fs";
7575
7591
  var {Glob: Glob7 } = globalThis.Bun;
7576
- import { resolve as resolve18 } from "path";
7592
+ import { resolve as resolve19 } from "path";
7577
7593
  var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath) => {
7578
7594
  const lower = filePath.toLowerCase();
7579
7595
  if (lower.endsWith(".ts") || lower.endsWith(".tsx") || lower.endsWith(".jsx"))
@@ -7587,8 +7603,8 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7587
7603
  if (!importPath.startsWith(".") && !importPath.startsWith("/")) {
7588
7604
  return null;
7589
7605
  }
7590
- const fromDir = resolve18(fromFile, "..");
7591
- const normalized = resolve18(fromDir, importPath);
7606
+ const fromDir = resolve19(fromFile, "..");
7607
+ const normalized = resolve19(fromDir, importPath);
7592
7608
  const extensions = [
7593
7609
  ".ts",
7594
7610
  ".tsx",
@@ -7618,7 +7634,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7618
7634
  dependents.delete(normalizedPath);
7619
7635
  }
7620
7636
  }, addFileToGraph = (graph, filePath) => {
7621
- const normalizedPath = resolve18(filePath);
7637
+ const normalizedPath = resolve19(filePath);
7622
7638
  if (!existsSync18(normalizedPath))
7623
7639
  return;
7624
7640
  const dependencies = extractDependencies(normalizedPath);
@@ -7635,10 +7651,10 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7635
7651
  }, IGNORED_SEGMENTS, buildInitialDependencyGraph = (graph, directories) => {
7636
7652
  const processedFiles = new Set;
7637
7653
  const glob = new Glob7("**/*.{ts,tsx,js,jsx,vue,svelte,html,htm}");
7638
- const resolvedDirs = directories.map((dir) => resolve18(dir)).filter((dir) => existsSync18(dir));
7654
+ const resolvedDirs = directories.map((dir) => resolve19(dir)).filter((dir) => existsSync18(dir));
7639
7655
  const allFiles = resolvedDirs.flatMap((dir) => Array.from(glob.scanSync({ absolute: true, cwd: dir })));
7640
7656
  for (const file3 of allFiles) {
7641
- const fullPath = resolve18(file3);
7657
+ const fullPath = resolve19(file3);
7642
7658
  if (IGNORED_SEGMENTS.some((seg) => fullPath.includes(seg)))
7643
7659
  continue;
7644
7660
  if (processedFiles.has(fullPath))
@@ -7751,7 +7767,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7751
7767
  return [];
7752
7768
  }
7753
7769
  }, getAffectedFiles = (graph, changedFile) => {
7754
- const normalizedPath = resolve18(changedFile);
7770
+ const normalizedPath = resolve19(changedFile);
7755
7771
  const affected = new Set;
7756
7772
  const toProcess = [normalizedPath];
7757
7773
  const processNode = (current) => {
@@ -7791,7 +7807,7 @@ var emptyDependencyGraph, tsTranspiler, jsTranspiler, loaderForFile = (filePath)
7791
7807
  }
7792
7808
  graph.dependents.delete(normalizedPath);
7793
7809
  }, removeFileFromGraph = (graph, filePath) => {
7794
- const normalizedPath = resolve18(filePath);
7810
+ const normalizedPath = resolve19(filePath);
7795
7811
  removeDepsForFile(graph, normalizedPath);
7796
7812
  removeDependentsForFile(graph, normalizedPath);
7797
7813
  };
@@ -7834,12 +7850,12 @@ var globalVersionCounter = 0, createModuleVersionTracker = () => new Map, getNex
7834
7850
  };
7835
7851
 
7836
7852
  // src/dev/configResolver.ts
7837
- import { resolve as resolve19 } from "path";
7853
+ import { resolve as resolve20 } from "path";
7838
7854
  var resolveBuildPaths = (config) => {
7839
7855
  const cwd2 = process.cwd();
7840
7856
  const normalize = (path) => path.replace(/\\/g, "/");
7841
- const withDefault = (value, fallback) => normalize(resolve19(cwd2, value ?? fallback));
7842
- const optional = (value) => value ? normalize(resolve19(cwd2, value)) : undefined;
7857
+ const withDefault = (value, fallback) => normalize(resolve20(cwd2, value ?? fallback));
7858
+ const optional = (value) => value ? normalize(resolve20(cwd2, value)) : undefined;
7843
7859
  return {
7844
7860
  angularDir: optional(config.angularDirectory),
7845
7861
  assetsDir: optional(config.assetsDirectory),
@@ -8029,7 +8045,7 @@ var init_pathUtils = __esm(() => {
8029
8045
  // src/dev/fileWatcher.ts
8030
8046
  import { watch } from "fs";
8031
8047
  import { existsSync as existsSync19 } from "fs";
8032
- import { join as join20, resolve as resolve20 } from "path";
8048
+ import { join as join20, resolve as resolve21 } from "path";
8033
8049
  var safeRemoveFromGraph = (graph, fullPath) => {
8034
8050
  try {
8035
8051
  removeFileFromGraph(graph, fullPath);
@@ -8074,7 +8090,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
8074
8090
  }, addFileWatchers = (state, paths, onFileChange) => {
8075
8091
  const stylesDir = state.resolvedPaths?.stylesDir;
8076
8092
  paths.forEach((path) => {
8077
- const absolutePath = resolve20(path).replace(/\\/g, "/");
8093
+ const absolutePath = resolve21(path).replace(/\\/g, "/");
8078
8094
  if (!existsSync19(absolutePath)) {
8079
8095
  return;
8080
8096
  }
@@ -8085,7 +8101,7 @@ var safeRemoveFromGraph = (graph, fullPath) => {
8085
8101
  const watchPaths = getWatchPaths(config, state.resolvedPaths);
8086
8102
  const stylesDir = state.resolvedPaths?.stylesDir;
8087
8103
  watchPaths.forEach((path) => {
8088
- const absolutePath = resolve20(path).replace(/\\/g, "/");
8104
+ const absolutePath = resolve21(path).replace(/\\/g, "/");
8089
8105
  if (!existsSync19(absolutePath)) {
8090
8106
  return;
8091
8107
  }
@@ -8100,13 +8116,13 @@ var init_fileWatcher = __esm(() => {
8100
8116
  });
8101
8117
 
8102
8118
  // src/dev/assetStore.ts
8103
- import { resolve as resolve21 } from "path";
8119
+ import { resolve as resolve22 } from "path";
8104
8120
  import { readdir as readdir3, unlink } from "fs/promises";
8105
8121
  var mimeTypes, getMimeType = (filePath) => {
8106
8122
  const ext = filePath.slice(filePath.lastIndexOf("."));
8107
8123
  return mimeTypes[ext] ?? "application/octet-stream";
8108
8124
  }, HASHED_FILE_RE, stripHash = (webPath) => webPath.replace(/\.[a-z0-9]{8}(\.(js|css|mjs))$/, "$1"), processWalkEntry = (entry, dir, liveByIdentity, walkAndClean) => {
8109
- const fullPath = resolve21(dir, entry.name);
8125
+ const fullPath = resolve22(dir, entry.name);
8110
8126
  if (entry.isDirectory()) {
8111
8127
  return walkAndClean(fullPath);
8112
8128
  }
@@ -8122,10 +8138,10 @@ var mimeTypes, getMimeType = (filePath) => {
8122
8138
  }, cleanStaleAssets = async (store, manifest, buildDir) => {
8123
8139
  const liveByIdentity = new Map;
8124
8140
  for (const webPath of store.keys()) {
8125
- const diskPath = resolve21(buildDir, webPath.slice(1));
8141
+ const diskPath = resolve22(buildDir, webPath.slice(1));
8126
8142
  liveByIdentity.set(stripHash(diskPath), diskPath);
8127
8143
  }
8128
- const absBuildDir = resolve21(buildDir);
8144
+ const absBuildDir = resolve22(buildDir);
8129
8145
  Object.values(manifest).forEach((val) => {
8130
8146
  if (!HASHED_FILE_RE.test(val))
8131
8147
  return;
@@ -8143,7 +8159,7 @@ var mimeTypes, getMimeType = (filePath) => {
8143
8159
  } catch {}
8144
8160
  }, lookupAsset = (store, path) => store.get(path), processScanEntry = (entry, dir, prefix, store, scanDir) => {
8145
8161
  if (entry.isDirectory()) {
8146
- return scanDir(resolve21(dir, entry.name), `${prefix}${entry.name}/`);
8162
+ return scanDir(resolve22(dir, entry.name), `${prefix}${entry.name}/`);
8147
8163
  }
8148
8164
  if (!entry.name.startsWith("chunk-")) {
8149
8165
  return null;
@@ -8152,7 +8168,7 @@ var mimeTypes, getMimeType = (filePath) => {
8152
8168
  if (store.has(webPath)) {
8153
8169
  return null;
8154
8170
  }
8155
- return Bun.file(resolve21(dir, entry.name)).bytes().then((bytes) => {
8171
+ return Bun.file(resolve22(dir, entry.name)).bytes().then((bytes) => {
8156
8172
  store.set(webPath, bytes);
8157
8173
  return;
8158
8174
  }).catch(() => {});
@@ -8177,7 +8193,7 @@ var mimeTypes, getMimeType = (filePath) => {
8177
8193
  for (const webPath of newIdentities.values()) {
8178
8194
  if (store.has(webPath))
8179
8195
  continue;
8180
- loadPromises.push(Bun.file(resolve21(buildDir, webPath.slice(1))).bytes().then((bytes) => {
8196
+ loadPromises.push(Bun.file(resolve22(buildDir, webPath.slice(1))).bytes().then((bytes) => {
8181
8197
  store.set(webPath, bytes);
8182
8198
  return;
8183
8199
  }).catch(() => {}));
@@ -8208,7 +8224,7 @@ var init_assetStore = __esm(() => {
8208
8224
 
8209
8225
  // src/islands/pageMetadata.ts
8210
8226
  import { readFileSync as readFileSync11 } from "fs";
8211
- import { dirname as dirname11, resolve as resolve22 } from "path";
8227
+ import { dirname as dirname11, resolve as resolve23 } from "path";
8212
8228
  var pagePatterns, getPageDirs = (config) => [
8213
8229
  { dir: config.angularDirectory, framework: "angular" },
8214
8230
  { dir: config.reactDirectory, framework: "react" },
@@ -8227,15 +8243,15 @@ var pagePatterns, getPageDirs = (config) => [
8227
8243
  const source = definition.buildReference?.source;
8228
8244
  if (!source)
8229
8245
  continue;
8230
- const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve22(dirname11(buildInfo.resolvedRegistryPath), source);
8231
- lookup.set(`${definition.framework}:${definition.component}`, resolve22(resolvedSource));
8246
+ const resolvedSource = source.startsWith("file://") ? new URL(source).pathname : resolve23(dirname11(buildInfo.resolvedRegistryPath), source);
8247
+ lookup.set(`${definition.framework}:${definition.component}`, resolve23(resolvedSource));
8232
8248
  }
8233
8249
  return lookup;
8234
8250
  }, getCurrentPageIslandMetadata = () => globalThis.__absolutePageIslandMetadata ?? new Map, metadataUsesSource = (metadata, target) => metadata.islands.some((usage) => {
8235
8251
  const candidate = usage.source;
8236
- return candidate ? resolve22(candidate) === target : false;
8252
+ return candidate ? resolve23(candidate) === target : false;
8237
8253
  }), getPagesUsingIslandSource = (sourcePath) => {
8238
- const target = resolve22(sourcePath);
8254
+ const target = resolve23(sourcePath);
8239
8255
  return [...getCurrentPageIslandMetadata().values()].filter((metadata) => metadataUsesSource(metadata, target)).map((metadata) => metadata.pagePath);
8240
8256
  }, resolveIslandUsages = (islands, islandSourceLookup) => islands.map((usage) => {
8241
8257
  const sourcePath = islandSourceLookup.get(`${usage.framework}:${usage.component}`);
@@ -8247,13 +8263,13 @@ var pagePatterns, getPageDirs = (config) => [
8247
8263
  const pattern = pagePatterns[entry.framework];
8248
8264
  if (!pattern)
8249
8265
  return;
8250
- const files = await scanEntryPoints(resolve22(entry.dir), pattern);
8266
+ const files = await scanEntryPoints(resolve23(entry.dir), pattern);
8251
8267
  for (const filePath of files) {
8252
8268
  const source = readFileSync11(filePath, "utf-8");
8253
8269
  const islands = extractIslandUsagesFromSource(source);
8254
- pageMetadata.set(resolve22(filePath), {
8270
+ pageMetadata.set(resolve23(filePath), {
8255
8271
  islands: resolveIslandUsages(islands, islandSourceLookup),
8256
- pagePath: resolve22(filePath)
8272
+ pagePath: resolve23(filePath)
8257
8273
  });
8258
8274
  }
8259
8275
  }, loadPageIslandMetadata = async (config) => {
@@ -8300,9 +8316,9 @@ var init_fileHashTracker = __esm(() => {
8300
8316
  });
8301
8317
 
8302
8318
  // src/dev/reactComponentClassifier.ts
8303
- import { resolve as resolve23 } from "path";
8319
+ import { resolve as resolve24 } from "path";
8304
8320
  var classifyComponent = (filePath) => {
8305
- const normalizedPath = resolve23(filePath);
8321
+ const normalizedPath = resolve24(filePath);
8306
8322
  if (normalizedPath.includes("/react/pages/")) {
8307
8323
  return "server";
8308
8324
  }
@@ -8314,7 +8330,7 @@ var classifyComponent = (filePath) => {
8314
8330
  var init_reactComponentClassifier = () => {};
8315
8331
 
8316
8332
  // src/dev/moduleMapper.ts
8317
- import { basename as basename8, resolve as resolve24 } from "path";
8333
+ import { basename as basename8, resolve as resolve25 } from "path";
8318
8334
  var buildModulePaths = (moduleKeys, manifest) => {
8319
8335
  const modulePaths = {};
8320
8336
  moduleKeys.forEach((key) => {
@@ -8324,7 +8340,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
8324
8340
  });
8325
8341
  return modulePaths;
8326
8342
  }, processChangedFile = (sourceFile, framework, manifest, resolvedPaths, processedFiles) => {
8327
- const normalizedFile = resolve24(sourceFile);
8343
+ const normalizedFile = resolve25(sourceFile);
8328
8344
  const normalizedPath = normalizedFile.replace(/\\/g, "/");
8329
8345
  if (processedFiles.has(normalizedFile)) {
8330
8346
  return null;
@@ -8360,7 +8376,7 @@ var buildModulePaths = (moduleKeys, manifest) => {
8360
8376
  });
8361
8377
  return grouped;
8362
8378
  }, mapSourceFileToManifestKeys = (sourceFile, framework, resolvedPaths) => {
8363
- const normalizedFile = resolve24(sourceFile);
8379
+ const normalizedFile = resolve25(sourceFile);
8364
8380
  const fileName = basename8(normalizedFile);
8365
8381
  const baseName = fileName.replace(/\.(tsx?|jsx?|vue|svelte|css|html)$/, "");
8366
8382
  const pascalName = toPascal(baseName);
@@ -9300,19 +9316,19 @@ var init_streamingSlotWarningScope = __esm(() => {
9300
9316
  import { AsyncLocalStorage as AsyncLocalStorage3 } from "async_hooks";
9301
9317
  import { mkdir as mkdir4, symlink } from "fs/promises";
9302
9318
  import { tmpdir } from "os";
9303
- import { basename as basename10, dirname as dirname12, join as join21, resolve as resolve25 } from "path";
9319
+ import { basename as basename10, dirname as dirname12, join as join21, resolve as resolve26 } from "path";
9304
9320
  var ssrDirty = false, lastSelector = "angular-page", isRecord7 = (value) => typeof value === "object" && value !== null, isAngularComponent = (value) => typeof value === "function", compilerImportPromise = null, ensureAngularCompiler = () => {
9305
9321
  if (!compilerImportPromise) {
9306
9322
  compilerImportPromise = import("@angular/compiler");
9307
9323
  }
9308
9324
  return compilerImportPromise;
9309
9325
  }, readAngularPageModule = (value) => isRecord7(value) ? value : null, resolveAngularSsrOutDir = () => process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR ?? join21(tmpdir(), "absolutejs", "generated", "angular-ssr"), ensureAngularSsrNodeModules = async (outDir) => {
9310
- const outRoot = resolve25(dirname12(dirname12(outDir)));
9326
+ const outRoot = resolve26(dirname12(dirname12(outDir)));
9311
9327
  const nodeModulesLink = join21(outRoot, "node_modules");
9312
9328
  if (process.env.ABSOLUTE_ANGULAR_SSR_OUTDIR) {
9313
9329
  return;
9314
9330
  }
9315
- if (nodeModulesLink === resolve25(process.cwd(), "node_modules")) {
9331
+ if (nodeModulesLink === resolve26(process.cwd(), "node_modules")) {
9316
9332
  return;
9317
9333
  }
9318
9334
  if (await Bun.file(nodeModulesLink).exists()) {
@@ -9320,7 +9336,7 @@ var ssrDirty = false, lastSelector = "angular-page", isRecord7 = (value) => type
9320
9336
  }
9321
9337
  await mkdir4(outRoot, { recursive: true });
9322
9338
  try {
9323
- await symlink(resolve25(process.cwd(), "node_modules"), nodeModulesLink, "dir");
9339
+ await symlink(resolve26(process.cwd(), "node_modules"), nodeModulesLink, "dir");
9324
9340
  } catch (error) {
9325
9341
  if (!(error instanceof Error) || !("code" in error) || error.code !== "EEXIST") {
9326
9342
  throw error;
@@ -9840,7 +9856,7 @@ __export(exports_moduleServer, {
9840
9856
  SRC_URL_PREFIX: () => SRC_URL_PREFIX
9841
9857
  });
9842
9858
  import { existsSync as existsSync20, readFileSync as readFileSync13, statSync as statSync2 } from "fs";
9843
- import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve26, relative as relative10 } from "path";
9859
+ import { basename as basename12, dirname as dirname14, extname as extname6, resolve as resolve27, relative as relative10 } from "path";
9844
9860
  var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPILABLE, ALL_EXPORTS_RE, STRING_CONTENTS_RE, preserveTypeExports = (originalSource, transpiled, valueExports) => {
9845
9861
  const codeOnly = originalSource.replace(STRING_CONTENTS_RE, '""');
9846
9862
  const allExports = [];
@@ -9860,7 +9876,7 @@ var SRC_PREFIX = "/@src/", jsTranspiler2, tsTranspiler2, tsxTranspiler, TRANSPIL
9860
9876
  ${stubs}
9861
9877
  `;
9862
9878
  }, resolveRelativeExtension = (srcPath, projectRoot, extensions) => {
9863
- const found = extensions.find((ext) => existsSync20(resolve26(projectRoot, srcPath + ext)));
9879
+ const found = extensions.find((ext) => existsSync20(resolve27(projectRoot, srcPath + ext)));
9864
9880
  return found ? srcPath + found : srcPath;
9865
9881
  }, IMPORT_EXTENSIONS, SIDE_EFFECT_EXTENSIONS, MODULE_EXTENSIONS, RESOLVED_MODULE_EXTENSIONS, REACT_EXTENSIONS, escapeRegex3 = (str) => str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), buildImportRewriter = (vendorPaths) => {
9866
9882
  const entries = Object.entries(vendorPaths).sort(([a], [b]) => b.length - a.length);
@@ -9875,7 +9891,7 @@ ${stubs}
9875
9891
  return invalidationVersion > 0 ? `${mtime}.${invalidationVersion}` : `${mtime}`;
9876
9892
  }, srcUrl = (relPath, projectRoot) => {
9877
9893
  const base = `${SRC_PREFIX}${relPath.replace(/\\/g, "/")}`;
9878
- const absPath = resolve26(projectRoot, relPath);
9894
+ const absPath = resolve27(projectRoot, relPath);
9879
9895
  const cached = mtimeCache.get(absPath);
9880
9896
  if (cached !== undefined)
9881
9897
  return `${base}?v=${buildVersion(cached, absPath)}`;
@@ -9887,12 +9903,12 @@ ${stubs}
9887
9903
  return base;
9888
9904
  }
9889
9905
  }, resolveRelativeImport = (relPath, fileDir, projectRoot, extensions) => {
9890
- const absPath = resolve26(fileDir, relPath);
9906
+ const absPath = resolve27(fileDir, relPath);
9891
9907
  const rel = relative10(projectRoot, absPath);
9892
9908
  const extension = extname6(rel);
9893
9909
  let srcPath = RESOLVED_MODULE_EXTENSIONS.has(extension) ? rel : resolveRelativeExtension(rel, projectRoot, extensions);
9894
9910
  if (extname6(srcPath) === ".svelte") {
9895
- srcPath = relative10(projectRoot, resolveSvelteModulePath(resolve26(projectRoot, srcPath)));
9911
+ srcPath = relative10(projectRoot, resolveSvelteModulePath(resolve27(projectRoot, srcPath)));
9896
9912
  }
9897
9913
  return srcUrl(srcPath, projectRoot);
9898
9914
  }, resolveAbsoluteSpecifier = (specifier, projectRoot) => {
@@ -9938,12 +9954,12 @@ ${stubs}
9938
9954
  return `${prefix}${srcUrl(rel, projectRoot)}${suffix}`;
9939
9955
  });
9940
9956
  result = result.replace(/new\s+URL\(\s*["'](\.\.?\/[^"']+)["']\s*,\s*import\.meta\.url\s*\)/g, (_match, relPath) => {
9941
- const absPath = resolve26(fileDir, relPath);
9957
+ const absPath = resolve27(fileDir, relPath);
9942
9958
  const rel = relative10(projectRoot, absPath);
9943
9959
  return `new URL('${srcUrl(rel, projectRoot)}', import.meta.url)`;
9944
9960
  });
9945
9961
  result = result.replace(/import\.meta\.resolve\(\s*["'](\.\.?\/[^"']+)["']\s*\)/g, (_match, relPath) => {
9946
- const absPath = resolve26(fileDir, relPath);
9962
+ const absPath = resolve27(fileDir, relPath);
9947
9963
  const rel = relative10(projectRoot, absPath);
9948
9964
  return `'${srcUrl(rel, projectRoot)}'`;
9949
9965
  });
@@ -10143,7 +10159,7 @@ ${code}`;
10143
10159
  ` + ` if (!window.__SVELTE_HMR_ACCEPT__) window.__SVELTE_HMR_ACCEPT__ = {};
10144
10160
  ` + ` var __hmr_accept = function(cb) { window.__SVELTE_HMR_ACCEPT__[${JSON.stringify(moduleUrl)}] = cb; };`);
10145
10161
  return code.replace(/import\.meta\.hot\.accept\(/g, "__hmr_accept(");
10146
- }, transformSvelteFile = async (filePath, projectRoot, rewriter) => {
10162
+ }, transformSvelteFile = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
10147
10163
  const raw = readFileSync13(filePath, "utf-8");
10148
10164
  if (!svelteCompiler) {
10149
10165
  svelteCompiler = await import("svelte/compiler");
@@ -10151,7 +10167,7 @@ ${code}`;
10151
10167
  const isModule = filePath.endsWith(".svelte.ts") || filePath.endsWith(".svelte.js");
10152
10168
  const loweredAwaitSource = isModule ? { code: raw, transformed: false } : lowerSvelteAwaitSlotSyntax(raw);
10153
10169
  const loweredSource = isModule ? loweredAwaitSource : lowerSvelteIslandSyntax(loweredAwaitSource.code, "client");
10154
- const source = loweredSource.code;
10170
+ const source = isModule ? loweredSource.code : (await svelteCompiler.preprocess(loweredSource.code, createSvelteStylePreprocessor(stylePreprocessors))).code;
10155
10171
  const enableAsync = loweredAwaitSource.transformed || loweredSource.transformed;
10156
10172
  const code = isModule ? compileSvelteModule(source, filePath) : compileSvelteComponent(source, filePath, projectRoot, enableAsync);
10157
10173
  return rewriteImports2(code, filePath, projectRoot, rewriter);
@@ -10178,16 +10194,16 @@ __script__.render = render;`;
10178
10194
  code += `
10179
10195
  export default __script__;`;
10180
10196
  return code;
10181
- }, compileVueStyles = (descriptor, filePath, componentId, code) => {
10197
+ }, compileVueStyles = async (descriptor, filePath, componentId, code, stylePreprocessors) => {
10182
10198
  if (descriptor.styles.length === 0)
10183
10199
  return code;
10184
- const cssCode = descriptor.styles.map((style) => vueCompiler.compileStyle({
10200
+ const cssCode = (await Promise.all(descriptor.styles.map(async (style) => vueCompiler.compileStyle({
10185
10201
  filename: filePath,
10186
10202
  id: `data-v-${componentId}`,
10187
10203
  scoped: style.scoped,
10188
- source: style.content,
10204
+ source: style.lang ? await compileStyleSource(filePath, style.content, style.lang, stylePreprocessors) : style.content,
10189
10205
  trim: true
10190
- }).code).join(`
10206
+ }).code))).join(`
10191
10207
  `);
10192
10208
  const escaped = cssCode.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10193
10209
  const hmrId = JSON.stringify(filePath);
@@ -10201,7 +10217,7 @@ export default __script__;`;
10201
10217
  ].join("");
10202
10218
  return `${cssInjection}
10203
10219
  ${code}`;
10204
- }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir) => {
10220
+ }, transformVueFile = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
10205
10221
  const raw = readFileSync13(filePath, "utf-8");
10206
10222
  if (!vueCompiler) {
10207
10223
  vueCompiler = await import("@vue/compiler-sfc");
@@ -10214,12 +10230,12 @@ ${code}`;
10214
10230
  inlineTemplate: false
10215
10231
  });
10216
10232
  let code = compileVueTemplate(descriptor, compiledScript, filePath, componentId);
10217
- code = compileVueStyles(descriptor, filePath, componentId, code);
10233
+ code = await compileVueStyles(descriptor, filePath, componentId, code, stylePreprocessors);
10218
10234
  code = tsTranspiler2.transformSync(code);
10219
10235
  code = injectVueHmr(code, filePath, projectRoot, vueDir);
10220
10236
  return rewriteImports2(code, filePath, projectRoot, rewriter);
10221
10237
  }, injectVueHmr = (code, filePath, projectRoot, vueDir) => {
10222
- const hmrBase = vueDir ? resolve26(vueDir) : projectRoot;
10238
+ const hmrBase = vueDir ? resolve27(vueDir) : projectRoot;
10223
10239
  const hmrId = relative10(hmrBase, filePath).replace(/\\/g, "/").replace(/\.vue$/, "");
10224
10240
  let result = code.replace(/export\s+default\s+/, "var __hmr_comp__ = ");
10225
10241
  result += [
@@ -10378,7 +10394,7 @@ export default {};
10378
10394
  const escaped = virtualCss.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$");
10379
10395
  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);`);
10380
10396
  }, resolveSourcePath = (relPath, projectRoot) => {
10381
- const filePath = resolve26(projectRoot, relPath);
10397
+ const filePath = resolve27(projectRoot, relPath);
10382
10398
  const ext = extname6(filePath);
10383
10399
  if (ext === ".svelte")
10384
10400
  return { ext, filePath: resolveSvelteModulePath(filePath) };
@@ -10391,7 +10407,7 @@ export default {};
10391
10407
  if (found === ".svelte")
10392
10408
  return { ext: found, filePath: resolveSvelteModulePath(resolved) };
10393
10409
  return { ext: found, filePath: resolved };
10394
- }, transformAndCache = async (filePath, ext, projectRoot, rewriter, vueDir) => {
10410
+ }, transformAndCache = async (filePath, ext, projectRoot, rewriter, vueDir, stylePreprocessors) => {
10395
10411
  if (ext === ".css")
10396
10412
  return jsResponse(handleCssRequest(filePath));
10397
10413
  const isSvelte = ext === ".svelte" || filePath.endsWith(".svelte.ts") || filePath.endsWith(".svelte.js");
@@ -10399,24 +10415,24 @@ export default {};
10399
10415
  if (cached)
10400
10416
  return jsResponse(cached);
10401
10417
  if (isSvelte)
10402
- return transformAndCacheSvelte(filePath, projectRoot, rewriter);
10418
+ return transformAndCacheSvelte(filePath, projectRoot, rewriter, stylePreprocessors);
10403
10419
  if (ext === ".vue")
10404
- return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir);
10420
+ return transformAndCacheVue(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
10405
10421
  if (!TRANSPILABLE.has(ext))
10406
10422
  return;
10407
10423
  const stat2 = statSync2(filePath);
10408
- const resolvedVueDir = vueDir ? resolve26(vueDir) : undefined;
10424
+ const resolvedVueDir = vueDir ? resolve27(vueDir) : undefined;
10409
10425
  const content = REACT_EXTENSIONS.has(ext) ? transformReactFile(filePath, projectRoot, rewriter) : transformPlainFile(filePath, projectRoot, rewriter, resolvedVueDir);
10410
10426
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
10411
10427
  return jsResponse(content);
10412
- }, transformAndCacheSvelte = async (filePath, projectRoot, rewriter) => {
10428
+ }, transformAndCacheSvelte = async (filePath, projectRoot, rewriter, stylePreprocessors) => {
10413
10429
  const stat2 = statSync2(filePath);
10414
- const content = await transformSvelteFile(filePath, projectRoot, rewriter);
10430
+ const content = await transformSvelteFile(filePath, projectRoot, rewriter, stylePreprocessors);
10415
10431
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
10416
10432
  return jsResponse(content);
10417
- }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir) => {
10433
+ }, transformAndCacheVue = async (filePath, projectRoot, rewriter, vueDir, stylePreprocessors) => {
10418
10434
  const stat2 = statSync2(filePath);
10419
- const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir);
10435
+ const content = await transformVueFile(filePath, projectRoot, rewriter, vueDir, stylePreprocessors);
10420
10436
  setTransformed(filePath, content, stat2.mtimeMs, extractImportedFiles(content, projectRoot));
10421
10437
  return jsResponse(content);
10422
10438
  }, transformErrorResponse = (err) => {
@@ -10426,7 +10442,7 @@ export default {};
10426
10442
  status: 500
10427
10443
  });
10428
10444
  }, createModuleServer = (config) => {
10429
- const { projectRoot, vendorPaths, frameworkDirs } = config;
10445
+ const { projectRoot, vendorPaths, frameworkDirs, stylePreprocessors } = config;
10430
10446
  const rewriter = buildImportRewriter(vendorPaths);
10431
10447
  return async (pathname) => {
10432
10448
  if (pathname.startsWith("/@stub/"))
@@ -10436,12 +10452,12 @@ export default {};
10436
10452
  if (!pathname.startsWith(SRC_PREFIX))
10437
10453
  return;
10438
10454
  const relPath = pathname.slice(SRC_PREFIX.length);
10439
- const virtualCssResponse = handleVirtualSvelteCss(resolve26(projectRoot, relPath));
10455
+ const virtualCssResponse = handleVirtualSvelteCss(resolve27(projectRoot, relPath));
10440
10456
  if (virtualCssResponse)
10441
10457
  return virtualCssResponse;
10442
10458
  const { filePath, ext } = resolveSourcePath(relPath, projectRoot);
10443
10459
  try {
10444
- return await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue);
10460
+ return await transformAndCache(filePath, ext, projectRoot, rewriter, frameworkDirs?.vue, stylePreprocessors);
10445
10461
  } catch (err) {
10446
10462
  return transformErrorResponse(err);
10447
10463
  }
@@ -10452,11 +10468,11 @@ export default {};
10452
10468
  SRC_IMPORT_RE.lastIndex = 0;
10453
10469
  while ((match = SRC_IMPORT_RE.exec(content)) !== null) {
10454
10470
  if (match[1])
10455
- files.push(resolve26(projectRoot, match[1]));
10471
+ files.push(resolve27(projectRoot, match[1]));
10456
10472
  }
10457
10473
  return files;
10458
10474
  }, invalidateModule = (filePath) => {
10459
- const resolved = resolve26(filePath);
10475
+ const resolved = resolve27(filePath);
10460
10476
  invalidate(filePath);
10461
10477
  if (resolved !== filePath)
10462
10478
  invalidate(resolved);
@@ -10475,6 +10491,7 @@ var init_moduleServer = __esm(() => {
10475
10491
  init_constants();
10476
10492
  init_resolvePackageImport();
10477
10493
  init_sourceMetadata();
10494
+ init_stylePreprocessor();
10478
10495
  init_lowerAwaitSlotSyntax();
10479
10496
  init_lowerIslandSyntax();
10480
10497
  init_transformCache();
@@ -10532,11 +10549,11 @@ var exports_simpleHTMLHMR = {};
10532
10549
  __export(exports_simpleHTMLHMR, {
10533
10550
  handleHTMLUpdate: () => handleHTMLUpdate
10534
10551
  });
10535
- import { resolve as resolve27 } from "path";
10552
+ import { resolve as resolve28 } from "path";
10536
10553
  var handleHTMLUpdate = async (htmlFilePath) => {
10537
10554
  let htmlContent;
10538
10555
  try {
10539
- const resolvedPath = resolve27(htmlFilePath);
10556
+ const resolvedPath = resolve28(htmlFilePath);
10540
10557
  const file3 = Bun.file(resolvedPath);
10541
10558
  if (!await file3.exists()) {
10542
10559
  return null;
@@ -10562,11 +10579,11 @@ var exports_simpleHTMXHMR = {};
10562
10579
  __export(exports_simpleHTMXHMR, {
10563
10580
  handleHTMXUpdate: () => handleHTMXUpdate
10564
10581
  });
10565
- import { resolve as resolve28 } from "path";
10582
+ import { resolve as resolve29 } from "path";
10566
10583
  var handleHTMXUpdate = async (htmxFilePath) => {
10567
10584
  let htmlContent;
10568
10585
  try {
10569
- const resolvedPath = resolve28(htmxFilePath);
10586
+ const resolvedPath = resolve29(htmxFilePath);
10570
10587
  const file3 = Bun.file(resolvedPath);
10571
10588
  if (!await file3.exists()) {
10572
10589
  return null;
@@ -10589,7 +10606,7 @@ var init_simpleHTMXHMR = () => {};
10589
10606
 
10590
10607
  // src/dev/rebuildTrigger.ts
10591
10608
  import { existsSync as existsSync21 } from "fs";
10592
- import { basename as basename13, dirname as dirname15, relative as relative11, resolve as resolve29 } from "path";
10609
+ import { basename as basename13, dirname as dirname15, relative as relative11, resolve as resolve30 } from "path";
10593
10610
  var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseErrorLocationFromMessage = (msg) => {
10594
10611
  const pathLineCol = msg.match(/^([^\s:]+):(\d+)(?::(\d+))?/);
10595
10612
  if (pathLineCol) {
@@ -10661,7 +10678,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10661
10678
  state.fileHashes.delete(filePathInSet);
10662
10679
  try {
10663
10680
  const affectedFiles = getAffectedFiles(state.dependencyGraph, filePathInSet);
10664
- const deletedPathResolved = resolve29(filePathInSet);
10681
+ const deletedPathResolved = resolve30(filePathInSet);
10665
10682
  affectedFiles.forEach((affectedFile) => {
10666
10683
  if (isValidDeletedAffectedFile(affectedFile, deletedPathResolved, processedFiles)) {
10667
10684
  validFiles.push(affectedFile);
@@ -10705,7 +10722,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10705
10722
  if (storedHash !== undefined && storedHash === fileHash) {
10706
10723
  return;
10707
10724
  }
10708
- const normalizedFilePath = resolve29(filePathInSet);
10725
+ const normalizedFilePath = resolve30(filePathInSet);
10709
10726
  if (!processedFiles.has(normalizedFilePath)) {
10710
10727
  validFiles.push(normalizedFilePath);
10711
10728
  processedFiles.add(normalizedFilePath);
@@ -10783,7 +10800,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10783
10800
  }
10784
10801
  if (framework === "unknown") {
10785
10802
  const { invalidate: invalidate2 } = (init_transformCache(), __toCommonJS(exports_transformCache));
10786
- invalidate2(resolve29(filePath));
10803
+ invalidate2(resolve30(filePath));
10787
10804
  const relPath = relative11(process.cwd(), filePath);
10788
10805
  logHmrUpdate(relPath);
10789
10806
  return;
@@ -10829,7 +10846,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10829
10846
  }
10830
10847
  if (!graph)
10831
10848
  return componentFile;
10832
- const dependents = graph.dependents.get(resolve29(componentFile));
10849
+ const dependents = graph.dependents.get(resolve30(componentFile));
10833
10850
  if (!dependents)
10834
10851
  return componentFile;
10835
10852
  for (const dep of dependents) {
@@ -10838,7 +10855,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10838
10855
  }
10839
10856
  return componentFile;
10840
10857
  }, resolveAngularPageEntries = (state, angularFiles, angularPagesPath) => {
10841
- const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") && resolve29(file3).startsWith(angularPagesPath));
10858
+ const pageEntries = angularFiles.filter((file3) => file3.endsWith(".ts") && resolve30(file3).startsWith(angularPagesPath));
10842
10859
  if (pageEntries.length > 0 || !state.dependencyGraph) {
10843
10860
  return pageEntries;
10844
10861
  }
@@ -10847,7 +10864,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10847
10864
  const lookupFile = resolveComponentLookupFile(componentFile, state.dependencyGraph);
10848
10865
  const affected = getAffectedFiles(state.dependencyGraph, lookupFile);
10849
10866
  affected.forEach((file3) => {
10850
- if (file3.endsWith(".ts") && resolve29(file3).startsWith(angularPagesPath)) {
10867
+ if (file3.endsWith(".ts") && resolve30(file3).startsWith(angularPagesPath)) {
10851
10868
  resolvedPages.add(file3);
10852
10869
  }
10853
10870
  });
@@ -10897,7 +10914,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10897
10914
  format: "esm",
10898
10915
  naming: "[dir]/[name].[hash].[ext]",
10899
10916
  outdir: buildDir,
10900
- plugins: [stylePreprocessorPlugin],
10917
+ plugins: [
10918
+ createStylePreprocessorPlugin(state.config.stylePreprocessors)
10919
+ ],
10901
10920
  root: clientRoot,
10902
10921
  target: "browser",
10903
10922
  throw: false
@@ -10938,10 +10957,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10938
10957
  });
10939
10958
  }, compileAndBundleAngular = async (state, pageEntries, angularDir) => {
10940
10959
  const { compileAngular: compileAngular2 } = await Promise.resolve().then(() => (init_compileAngular(), exports_compileAngular));
10941
- const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true);
10960
+ const { clientPaths, serverPaths } = await compileAngular2(pageEntries, angularDir, true, state.config.stylePreprocessors);
10942
10961
  serverPaths.forEach((serverPath) => {
10943
10962
  const fileBase = basename13(serverPath, ".js");
10944
- state.manifest[toPascal(fileBase)] = resolve29(serverPath);
10963
+ state.manifest[toPascal(fileBase)] = resolve30(serverPath);
10945
10964
  });
10946
10965
  if (clientPaths.length > 0) {
10947
10966
  await bundleAngularClient(state, clientPaths, state.resolvedPaths.buildDir);
@@ -10950,9 +10969,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10950
10969
  const angularDir = config.angularDirectory ?? "";
10951
10970
  const angularFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "angular");
10952
10971
  for (const file3 of angularFiles) {
10953
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
10972
+ state.fileHashes.set(resolve30(file3), computeFileHash(file3));
10954
10973
  }
10955
- const angularPagesPath = resolve29(angularDir, "pages");
10974
+ const angularPagesPath = resolve30(angularDir, "pages");
10956
10975
  const pageEntries = resolveAngularPageEntries(state, angularFiles, angularPagesPath);
10957
10976
  if (pageEntries.length > 0) {
10958
10977
  await compileAndBundleAngular(state, pageEntries, angularDir);
@@ -10967,7 +10986,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10967
10986
  return manifest;
10968
10987
  }, resolveReactEntryForPageFile = (normalized, pagesPathResolved, reactIndexesPath) => {
10969
10988
  const pageName = basename13(normalized, ".tsx");
10970
- const indexPath = resolve29(reactIndexesPath, `${pageName}.tsx`);
10989
+ const indexPath = resolve30(reactIndexesPath, `${pageName}.tsx`);
10971
10990
  if (!existsSync21(indexPath)) {
10972
10991
  return;
10973
10992
  }
@@ -10979,13 +10998,13 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10979
10998
  return;
10980
10999
  }
10981
11000
  const pageName = basename13(dep, ".tsx");
10982
- const indexPath = resolve29(reactIndexesPath, `${pageName}.tsx`);
11001
+ const indexPath = resolve30(reactIndexesPath, `${pageName}.tsx`);
10983
11002
  if (existsSync21(indexPath) && !reactEntries.includes(indexPath)) {
10984
11003
  reactEntries.push(indexPath);
10985
11004
  }
10986
11005
  });
10987
11006
  }, resolveReactEntryForFile = (state, file3, pagesPathResolved, reactIndexesPath, reactEntries) => {
10988
- const normalized = resolve29(file3);
11007
+ const normalized = resolve30(file3);
10989
11008
  if (!normalized.startsWith(pagesPathResolved)) {
10990
11009
  resolveReactEntriesFromDeps(state, normalized, pagesPathResolved, reactIndexesPath, reactEntries);
10991
11010
  return;
@@ -10996,7 +11015,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
10996
11015
  }
10997
11016
  }, collectReactEntries = (state, filesToRebuild, reactPagesPath, reactIndexesPath) => {
10998
11017
  const reactEntries = [];
10999
- const pagesPathResolved = resolve29(reactPagesPath);
11018
+ const pagesPathResolved = resolve30(reactPagesPath);
11000
11019
  filesToRebuild.forEach((file3) => {
11001
11020
  resolveReactEntryForFile(state, file3, pagesPathResolved, reactIndexesPath, reactEntries);
11002
11021
  });
@@ -11008,7 +11027,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11008
11027
  const { rewriteReactImports: rewriteReactImports2 } = await Promise.resolve().then(() => (init_rewriteReactImports(), exports_rewriteReactImports));
11009
11028
  const clientRoot = await computeClientRoot(state.resolvedPaths);
11010
11029
  const depVendorPaths = globalThis.__depVendorPaths ?? {};
11011
- const refreshEntry = resolve29(reactIndexesPath, "_refresh.tsx");
11030
+ const refreshEntry = resolve30(reactIndexesPath, "_refresh.tsx");
11012
11031
  if (!reactEntries.includes(refreshEntry)) {
11013
11032
  reactEntries.push(refreshEntry);
11014
11033
  }
@@ -11020,7 +11039,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11020
11039
  setDevVendorPaths2(vendorPaths);
11021
11040
  }
11022
11041
  const { rmSync: rmSync3 } = await import("fs");
11023
- rmSync3(resolve29(buildDir, "react", "generated", "indexes"), {
11042
+ rmSync3(resolve30(buildDir, "react", "generated", "indexes"), {
11024
11043
  force: true,
11025
11044
  recursive: true
11026
11045
  });
@@ -11030,7 +11049,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11030
11049
  jsx: { development: true },
11031
11050
  naming: "[dir]/[name].[hash].[ext]",
11032
11051
  outdir: buildDir,
11033
- plugins: [stylePreprocessorPlugin],
11052
+ plugins: [
11053
+ createStylePreprocessorPlugin(state.config.stylePreprocessors)
11054
+ ],
11034
11055
  reactFastRefresh: true,
11035
11056
  root: clientRoot,
11036
11057
  splitting: true,
@@ -11070,11 +11091,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11070
11091
  if (isComponentFile2)
11071
11092
  return primaryFile;
11072
11093
  const { findNearestComponent: findNearestComponent2 } = await Promise.resolve().then(() => (init_transformCache(), exports_transformCache));
11073
- const nearest = findNearestComponent2(resolve29(primaryFile));
11094
+ const nearest = findNearestComponent2(resolve30(primaryFile));
11074
11095
  return nearest ?? primaryFile;
11075
11096
  }, handleReactModuleServerPath = async (state, reactFiles, startTime, onRebuildComplete) => {
11076
11097
  for (const file3 of reactFiles) {
11077
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
11098
+ state.fileHashes.set(resolve30(file3), computeFileHash(file3));
11078
11099
  }
11079
11100
  invalidateReactSsrCache();
11080
11101
  const primaryFile = reactFiles.find((file3) => !file3.replace(/\\/g, "/").includes("/pages/")) ?? reactFiles[0];
@@ -11116,8 +11137,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11116
11137
  return state.manifest;
11117
11138
  }, handleReactFastPath = async (state, config, filesToRebuild, startTime, onRebuildComplete) => {
11118
11139
  const reactDir = config.reactDirectory ?? "";
11119
- const reactPagesPath = resolve29(reactDir, "pages");
11120
- const reactIndexesPath = resolve29(reactDir, "generated", "indexes");
11140
+ const reactPagesPath = resolve30(reactDir, "pages");
11141
+ const reactIndexesPath = resolve30(reactDir, "generated", "indexes");
11121
11142
  const { buildDir } = state.resolvedPaths;
11122
11143
  const reactFiles = filesToRebuild.filter((file3) => detectFramework(file3, state.resolvedPaths) === "react");
11123
11144
  if (reactFiles.length > 0) {
@@ -11180,7 +11201,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11180
11201
  });
11181
11202
  }, handleSvelteModuleServerPath = async (state, svelteFiles, startTime, onRebuildComplete) => {
11182
11203
  for (const file3 of svelteFiles) {
11183
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
11204
+ state.fileHashes.set(resolve30(file3), computeFileHash(file3));
11184
11205
  }
11185
11206
  invalidateSvelteSsrCache();
11186
11207
  const serverDuration = Date.now() - startTime;
@@ -11203,11 +11224,11 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11203
11224
  const { compileSvelte: compileSvelte2 } = await Promise.resolve().then(() => (init_compileSvelte(), exports_compileSvelte));
11204
11225
  const { build: bunBuild7 } = await Promise.resolve(globalThis.Bun);
11205
11226
  const clientRoot = await computeClientRoot(state.resolvedPaths);
11206
- const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true);
11227
+ const { svelteServerPaths, svelteIndexPaths, svelteClientPaths } = await compileSvelte2(svelteFiles, svelteDir, new Map, true, state.config.stylePreprocessors);
11207
11228
  const serverEntries = [...svelteServerPaths];
11208
11229
  const clientEntries = [...svelteIndexPaths, ...svelteClientPaths];
11209
- const serverRoot = resolve29(svelteDir, "generated", "server");
11210
- const serverOutDir = resolve29(buildDir, basename13(svelteDir));
11230
+ const serverRoot = resolve30(svelteDir, "generated", "server");
11231
+ const serverOutDir = resolve30(buildDir, basename13(svelteDir));
11211
11232
  const [serverResult, clientResult] = await Promise.all([
11212
11233
  serverEntries.length > 0 ? bunBuild7({
11213
11234
  entrypoints: serverEntries,
@@ -11222,7 +11243,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11222
11243
  format: "esm",
11223
11244
  naming: "[dir]/[name].[hash].[ext]",
11224
11245
  outdir: serverOutDir,
11225
- plugins: [stylePreprocessorPlugin],
11246
+ plugins: [
11247
+ createStylePreprocessorPlugin(state.config.stylePreprocessors)
11248
+ ],
11226
11249
  root: serverRoot,
11227
11250
  target: "bun",
11228
11251
  throw: false
@@ -11232,7 +11255,9 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11232
11255
  format: "esm",
11233
11256
  naming: "[dir]/[name].[hash].[ext]",
11234
11257
  outdir: buildDir,
11235
- plugins: [stylePreprocessorPlugin],
11258
+ plugins: [
11259
+ createStylePreprocessorPlugin(state.config.stylePreprocessors)
11260
+ ],
11236
11261
  root: clientRoot,
11237
11262
  target: "browser",
11238
11263
  throw: false
@@ -11300,7 +11325,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11300
11325
  });
11301
11326
  }, handleVueModuleServerPath = async (state, vueFiles, nonVueFiles, startTime, onRebuildComplete) => {
11302
11327
  for (const file3 of [...vueFiles, ...nonVueFiles]) {
11303
- state.fileHashes.set(resolve29(file3), computeFileHash(file3));
11328
+ state.fileHashes.set(resolve30(file3), computeFileHash(file3));
11304
11329
  }
11305
11330
  invalidateVueSsrCache();
11306
11331
  await invalidateNonVueModules(nonVueFiles);
@@ -11395,8 +11420,8 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11395
11420
  if (!buildReference?.source) {
11396
11421
  return;
11397
11422
  }
11398
- const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve29(dirname15(buildInfo.resolvedRegistryPath), buildReference.source);
11399
- islandFiles.add(resolve29(sourcePath));
11423
+ const sourcePath = buildReference.source.startsWith("file://") ? new URL(buildReference.source).pathname : resolve30(dirname15(buildInfo.resolvedRegistryPath), buildReference.source);
11424
+ islandFiles.add(resolve30(sourcePath));
11400
11425
  }, resolveIslandSourceFiles = async (config) => {
11401
11426
  const registryPath = config.islands?.registry;
11402
11427
  if (!registryPath) {
@@ -11404,7 +11429,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11404
11429
  }
11405
11430
  const buildInfo = await loadIslandRegistryBuildInfo(registryPath);
11406
11431
  const islandFiles = new Set([
11407
- resolve29(buildInfo.resolvedRegistryPath)
11432
+ resolve30(buildInfo.resolvedRegistryPath)
11408
11433
  ]);
11409
11434
  for (const definition of buildInfo.definitions) {
11410
11435
  resolveIslandDefinitionSource(definition, buildInfo, islandFiles);
@@ -11415,7 +11440,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11415
11440
  if (islandFiles.size === 0) {
11416
11441
  return false;
11417
11442
  }
11418
- return filesToRebuild.some((file3) => islandFiles.has(resolve29(file3)));
11443
+ return filesToRebuild.some((file3) => islandFiles.has(resolve30(file3)));
11419
11444
  }, handleIslandSourceReload = async (state, config, filesToRebuild, manifest) => {
11420
11445
  const shouldReload = await didStaticPagesNeedIslandRefresh(config, filesToRebuild);
11421
11446
  if (!shouldReload) {
@@ -11450,10 +11475,10 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11450
11475
  }, computeOutputPagesDir = (state, config, framework) => {
11451
11476
  const isSingle = !config.reactDirectory && !config.svelteDirectory && !config.vueDirectory && (framework === "html" ? !config.htmxDirectory : !config.htmlDirectory);
11452
11477
  if (isSingle) {
11453
- return resolve29(state.resolvedPaths.buildDir, "pages");
11478
+ return resolve30(state.resolvedPaths.buildDir, "pages");
11454
11479
  }
11455
11480
  const dirName = framework === "html" ? basename13(config.htmlDirectory ?? "html") : basename13(config.htmxDirectory ?? "htmx");
11456
- return resolve29(state.resolvedPaths.buildDir, dirName, "pages");
11481
+ return resolve30(state.resolvedPaths.buildDir, dirName, "pages");
11457
11482
  }, processHtmlPageUpdate = async (state, pageFile, builtHtmlPagePath, manifest, duration) => {
11458
11483
  try {
11459
11484
  const { handleHTMLUpdate: handleHTMLUpdate2 } = await Promise.resolve().then(() => (init_simpleHTMLHMR(), exports_simpleHTMLHMR));
@@ -11492,7 +11517,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11492
11517
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmlPages, "*.html") : htmlPageFiles;
11493
11518
  for (const pageFile of pageFilesToUpdate) {
11494
11519
  const htmlPageName = basename13(pageFile);
11495
- const builtHtmlPagePath = resolve29(outputHtmlPages, htmlPageName);
11520
+ const builtHtmlPagePath = resolve30(outputHtmlPages, htmlPageName);
11496
11521
  await processHtmlPageUpdate(state, pageFile, builtHtmlPagePath, manifest, duration);
11497
11522
  }
11498
11523
  }, handleVueCssOnlyUpdate = (state, vueCssFiles, manifest, duration) => {
@@ -11557,7 +11582,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11557
11582
  const cssKey = `${pascalName}CSS`;
11558
11583
  const cssUrl = manifest[cssKey] || null;
11559
11584
  const { vueHmrMetadata: vueHmrMetadata2 } = await Promise.resolve().then(() => (init_compileVue(), exports_compileVue));
11560
- const hmrMeta = vueHmrMetadata2.get(resolve29(vuePagePath));
11585
+ const hmrMeta = vueHmrMetadata2.get(resolve30(vuePagePath));
11561
11586
  const changeType = hmrMeta?.changeType ?? "full";
11562
11587
  if (changeType === "style-only") {
11563
11588
  broadcastVueStyleOnly(state, vuePagePath, baseName, cssUrl, hmrId, manifest, duration);
@@ -11794,7 +11819,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11794
11819
  const pageFilesToUpdate = shouldRefreshAllPages ? await scanEntryPoints(outputHtmxPages, "*.html") : htmxPageFiles;
11795
11820
  for (const htmxPageFile of pageFilesToUpdate) {
11796
11821
  const htmxPageName = basename13(htmxPageFile);
11797
- const builtHtmxPagePath = resolve29(outputHtmxPages, htmxPageName);
11822
+ const builtHtmxPagePath = resolve30(outputHtmxPages, htmxPageName);
11798
11823
  await processHtmxPageUpdate(state, htmxPageFile, builtHtmxPagePath, manifest, duration);
11799
11824
  }
11800
11825
  }, collectUpdatedModulePaths = (allModuleUpdates) => {
@@ -11903,7 +11928,7 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, parseError
11903
11928
  html = html.slice(0, bodyClose.index) + hmrScript + html.slice(bodyClose.index);
11904
11929
  writeFs(destPath, html);
11905
11930
  }, processMarkupFileFastPath = async (state, sourceFile, outputDir, framework, startTime, updateAssetPaths2, handleUpdate, readFs, writeFs) => {
11906
- const destPath = resolve29(outputDir, basename13(sourceFile));
11931
+ const destPath = resolve30(outputDir, basename13(sourceFile));
11907
11932
  const hmrScript = extractHmrScript(destPath, readFs);
11908
11933
  const source = await Bun.file(sourceFile).text();
11909
11934
  await Bun.write(destPath, source);
@@ -12299,7 +12324,7 @@ __export(exports_devBuild, {
12299
12324
  });
12300
12325
  import { readdir as readdir5 } from "fs/promises";
12301
12326
  import { statSync as statSync3 } from "fs";
12302
- import { dirname as dirname16, resolve as resolve30 } from "path";
12327
+ import { dirname as dirname16, resolve as resolve31 } from "path";
12303
12328
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12304
12329
  const configuredDirs = [
12305
12330
  config.reactDirectory,
@@ -12322,7 +12347,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12322
12347
  return Object.keys(config).length > 0 ? config : null;
12323
12348
  }, reloadConfig = async () => {
12324
12349
  try {
12325
- const configPath2 = resolve30(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
12350
+ const configPath2 = resolve31(process.env.ABSOLUTE_CONFIG ?? "absolute.config.ts");
12326
12351
  const source = await Bun.file(configPath2).text();
12327
12352
  return parseDirectoryConfig(source);
12328
12353
  } catch {
@@ -12402,7 +12427,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12402
12427
  state.fileChangeQueue.clear();
12403
12428
  }
12404
12429
  }, handleCachedReload = async () => {
12405
- const serverMtime = statSync3(resolve30(Bun.main)).mtimeMs;
12430
+ const serverMtime = statSync3(resolve31(Bun.main)).mtimeMs;
12406
12431
  const lastMtime = globalThis.__hmrServerMtime;
12407
12432
  globalThis.__hmrServerMtime = serverMtime;
12408
12433
  const cached = globalThis.__hmrDevResult;
@@ -12436,8 +12461,8 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12436
12461
  return true;
12437
12462
  }, resolveAbsoluteVersion2 = async () => {
12438
12463
  const candidates = [
12439
- resolve30(import.meta.dir, "..", "..", "package.json"),
12440
- resolve30(import.meta.dir, "..", "package.json")
12464
+ resolve31(import.meta.dir, "..", "..", "package.json"),
12465
+ resolve31(import.meta.dir, "..", "package.json")
12441
12466
  ];
12442
12467
  for (const candidate of candidates) {
12443
12468
  const found = await tryReadPackageVersion(candidate);
@@ -12450,7 +12475,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12450
12475
  const entries = await readdir5(vendorDir).catch(() => emptyStringArray);
12451
12476
  await Promise.all(entries.map(async (entry) => {
12452
12477
  const webPath = `/${framework}/vendor/${entry}`;
12453
- const bytes = await Bun.file(resolve30(vendorDir, entry)).bytes();
12478
+ const bytes = await Bun.file(resolve31(vendorDir, entry)).bytes();
12454
12479
  assetStore.set(webPath, bytes);
12455
12480
  }));
12456
12481
  }, devBuild = async (config) => {
@@ -12514,7 +12539,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12514
12539
  recordStep("populate asset store", stepStartedAt);
12515
12540
  stepStartedAt = performance.now();
12516
12541
  const buildReactVendorTask = config.reactDirectory ? buildReactVendor(state.resolvedPaths.buildDir).then(async () => {
12517
- const vendorDir = resolve30(state.resolvedPaths.buildDir, "react", "vendor");
12542
+ const vendorDir = resolve31(state.resolvedPaths.buildDir, "react", "vendor");
12518
12543
  await loadVendorFiles(state.assetStore, vendorDir, "react");
12519
12544
  if (!globalThis.__reactModuleRef) {
12520
12545
  globalThis.__reactModuleRef = await import("react");
@@ -12522,23 +12547,23 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12522
12547
  return true;
12523
12548
  }) : undefined;
12524
12549
  const buildAngularVendorTask = config.angularDirectory ? buildAngularVendor(state.resolvedPaths.buildDir).then(async () => {
12525
- const vendorDir = resolve30(state.resolvedPaths.buildDir, "angular", "vendor");
12550
+ const vendorDir = resolve31(state.resolvedPaths.buildDir, "angular", "vendor");
12526
12551
  await loadVendorFiles(state.assetStore, vendorDir, "angular");
12527
12552
  return true;
12528
12553
  }) : undefined;
12529
12554
  const buildSvelteVendorTask = config.svelteDirectory ? buildSvelteVendor(state.resolvedPaths.buildDir).then(async () => {
12530
- const vendorDir = resolve30(state.resolvedPaths.buildDir, "svelte", "vendor");
12555
+ const vendorDir = resolve31(state.resolvedPaths.buildDir, "svelte", "vendor");
12531
12556
  await loadVendorFiles(state.assetStore, vendorDir, "svelte");
12532
12557
  return true;
12533
12558
  }) : undefined;
12534
12559
  const buildVueVendorTask = config.vueDirectory ? buildVueVendor(state.resolvedPaths.buildDir).then(async () => {
12535
- const vendorDir = resolve30(state.resolvedPaths.buildDir, "vue", "vendor");
12560
+ const vendorDir = resolve31(state.resolvedPaths.buildDir, "vue", "vendor");
12536
12561
  await loadVendorFiles(state.assetStore, vendorDir, "vue");
12537
12562
  return true;
12538
12563
  }) : undefined;
12539
12564
  const { buildDepVendor: buildDepVendor2 } = await Promise.resolve().then(() => (init_buildDepVendor(), exports_buildDepVendor));
12540
12565
  const buildDepVendorTask = buildDepVendor2(state.resolvedPaths.buildDir, sourceDirs).then(async (depPaths) => {
12541
- const vendorDir = resolve30(state.resolvedPaths.buildDir, "vendor");
12566
+ const vendorDir = resolve31(state.resolvedPaths.buildDir, "vendor");
12542
12567
  await loadVendorFiles(state.assetStore, vendorDir, "vendor");
12543
12568
  globalThis.__depVendorPaths = depPaths;
12544
12569
  return true;
@@ -12575,7 +12600,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
12575
12600
  manifest
12576
12601
  };
12577
12602
  globalThis.__hmrDevResult = result;
12578
- globalThis.__hmrServerMtime = statSync3(resolve30(Bun.main)).mtimeMs;
12603
+ globalThis.__hmrServerMtime = statSync3(resolve31(Bun.main)).mtimeMs;
12579
12604
  return result;
12580
12605
  };
12581
12606
  var init_devBuild = __esm(() => {
@@ -12611,5 +12636,5 @@ export {
12611
12636
  build
12612
12637
  };
12613
12638
 
12614
- //# debugId=EC4B4C99B57596EF64756E2164756E21
12639
+ //# debugId=001509E3B3F3F26364756E2164756E21
12615
12640
  //# sourceMappingURL=build.js.map