vike 0.4.253-commit-aa63f56 → 0.4.253-commit-3e3975d

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.
@@ -202,7 +202,8 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
202
202
  // - vike@0.4.162 started soft-requiring Vike extensions to set the name config.
203
203
  // - In practice, it seems like it requires some (non-trivial?) refactoring.
204
204
  isVikeExtensionImport ||
205
- // Explicitly tagged as runtime code => pointer import
205
+ // `with { type: 'runtime' }` => regular pointer import so that the pointer import
206
+ // mechanism correctly encodes path + export name (import:path:exportName).
206
207
  args.with?.['type'] === 'runtime';
207
208
  assertPosixPath(importPathResolved);
208
209
  // `isNpmPkgImport` => `importPathOriginal` is most likely an npm package import, but it can also be a path alias that a) looks like an npm package import and b) resolves outside of `userRootDir`.
@@ -273,8 +274,10 @@ async function transpileWithEsbuild(filePath, userRootDir, transformImports, esb
273
274
  return { external: true, path: importPathTranspiled };
274
275
  });
275
276
  build.onLoad({ filter: /.*/, namespace: 'vike-static-file' }, (args) => {
277
+ // args.path is an absolute filesystem path; convert to a Vite-compatible path.
278
+ const vitePath = getFilePathAbsoluteUserRootDir({ filePathAbsoluteFilesystem: args.path, userRootDir }) ?? `/@fs${args.path}`;
276
279
  return {
277
- contents: `export default 'STATIC_FILE_NOT_AVAILABLE:${args.path}'`,
280
+ contents: `export default 'STATIC_FILE_NOT_AVAILABLE:${vitePath}'`,
278
281
  loader: 'js',
279
282
  };
280
283
  });
@@ -16,6 +16,7 @@ import { getConfigValueSourcesRelevant, isRuntimeEnvMatch, } from '../../../node
16
16
  const stringifyOptions = { forbidReactElements: true };
17
17
  const REPLACE_ME_BEFORE = '__VIKE__REPLACE_ME_BEFORE__';
18
18
  const REPLACE_ME_AFTER = '__VIKE__REPLACE_ME_AFTER__';
19
+ const STATIC_FILE_NOT_AVAILABLE_PREFIX = 'STATIC_FILE_NOT_AVAILABLE:';
19
20
  // This file is never loaded on the client-side but we save it under the vike/shared/ directory in order to collocate it with parsePageConfigsSerialized()
20
21
  // - vike/shared/page-configs/serialize/parsePageConfigsSerialized.ts
21
22
  // - parsePageConfigsSerialized() is loaded on both the client- and server-side.
@@ -141,6 +142,15 @@ function valueToJson(value, configName, definedAtData, importStatements, filesEn
141
142
  const replacement = [REPLACE_ME_BEFORE, importName, REPLACE_ME_AFTER].join('');
142
143
  return { replacement };
143
144
  }
145
+ // Handle STATIC_FILE_NOT_AVAILABLE strings: these are generated during config
146
+ // execution when a non-script file (e.g. .svg) or a `with { type: 'runtime' }`
147
+ // import is encountered. They must become runtime imports, not raw strings.
148
+ if (value.startsWith(STATIC_FILE_NOT_AVAILABLE_PREFIX)) {
149
+ const importPath = value.slice(STATIC_FILE_NOT_AVAILABLE_PREFIX.length);
150
+ const { importName } = addImportStatement(importStatements, importPath, 'default', filesEnv, configEnv, configName);
151
+ const replacement = [REPLACE_ME_BEFORE, importName, REPLACE_ME_AFTER].join('');
152
+ return { replacement };
153
+ }
144
154
  }
145
155
  },
146
156
  });
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.253-commit-aa63f56";
1
+ export declare const PROJECT_VERSION: "0.4.253-commit-3e3975d";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.253-commit-aa63f56';
2
+ export const PROJECT_VERSION = '0.4.253-commit-3e3975d';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.253-commit-aa63f56",
3
+ "version": "0.4.253-commit-3e3975d",
4
4
  "repository": "https://github.com/vikejs/vike",
5
5
  "exports": {
6
6
  "./server": {