vike 0.4.189 → 0.4.190

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.
@@ -53,7 +53,8 @@ function distFileNames() {
53
53
  }
54
54
  // Disable CSS bundling to workaround https://github.com/vikejs/vike/issues/1815
55
55
  if (id.endsWith('.css')) {
56
- if ((0, utils_js_1.isFilePathAbsolute)(id)) {
56
+ const userRootDir = config.root;
57
+ if (id.startsWith(userRootDir)) {
57
58
  (0, utils_js_1.assertPosixPath)(id);
58
59
  (0, getFilePath_js_1.assertModuleId)(id);
59
60
  let name;
@@ -65,10 +66,10 @@ function distFileNames() {
65
66
  const filePath = (0, getFilePath_js_1.getModuleFilePathAbsolute)(id, config);
66
67
  name = filePath;
67
68
  name = name.split('.').slice(0, -1).join('.'); // remove file extension
68
- name = name.split('/').join('_');
69
+ name = name.split('/').filter(Boolean).join('_');
69
70
  }
70
71
  // Make fileHash the same between local development and CI
71
- const idStable = path_1.default.posix.relative(config.root, id);
72
+ const idStable = path_1.default.posix.relative(userRootDir, id);
72
73
  // Don't remove `?` queries because each `id` should belong to a unique bundle.
73
74
  const hash = getIdHash(idStable);
74
75
  return `${name}-${hash}`;
@@ -76,13 +77,18 @@ function distFileNames() {
76
77
  else {
77
78
  let name;
78
79
  const isVirtualModule = id.match(/virtual:([^:]+):/);
79
- if (!isVirtualModule) {
80
- name = 'style';
81
- }
82
- else {
80
+ if (isVirtualModule) {
83
81
  name = isVirtualModule[1];
84
82
  (0, utils_js_1.assert)(name);
85
83
  }
84
+ else if (
85
+ // https://github.com/vikejs/vike/issues/1818#issuecomment-2298478321
86
+ id.startsWith('/__uno')) {
87
+ name = 'uno';
88
+ }
89
+ else {
90
+ name = 'style';
91
+ }
86
92
  const hash = getIdHash(id);
87
93
  return `${name}-${hash}`;
88
94
  }
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROJECT_VERSION = void 0;
4
4
  // Automatically updated by @brillout/release-me
5
- exports.PROJECT_VERSION = '0.4.189';
5
+ exports.PROJECT_VERSION = '0.4.190';
@@ -2,7 +2,7 @@ export { distFileNames };
2
2
  // Attempt to preserve file structure of `.page.js` files:
3
3
  // - https://github.com/vikejs/vike/commit/11a4c49e5403aa7c37c8020c462b499425b41854
4
4
  // - Blocker: https://github.com/rollup/rollup/issues/4724
5
- import { assertPosixPath, assert, assertUsage, isArray, isCallable, isFilePathAbsolute } from '../utils.js';
5
+ import { assertPosixPath, assert, assertUsage, isArray, isCallable } from '../utils.js';
6
6
  import path from 'path';
7
7
  import crypto from 'crypto';
8
8
  import { getAssetsDir } from '../shared/getAssetsDir.js';
@@ -48,7 +48,8 @@ function distFileNames() {
48
48
  }
49
49
  // Disable CSS bundling to workaround https://github.com/vikejs/vike/issues/1815
50
50
  if (id.endsWith('.css')) {
51
- if (isFilePathAbsolute(id)) {
51
+ const userRootDir = config.root;
52
+ if (id.startsWith(userRootDir)) {
52
53
  assertPosixPath(id);
53
54
  assertModuleId(id);
54
55
  let name;
@@ -60,10 +61,10 @@ function distFileNames() {
60
61
  const filePath = getModuleFilePathAbsolute(id, config);
61
62
  name = filePath;
62
63
  name = name.split('.').slice(0, -1).join('.'); // remove file extension
63
- name = name.split('/').join('_');
64
+ name = name.split('/').filter(Boolean).join('_');
64
65
  }
65
66
  // Make fileHash the same between local development and CI
66
- const idStable = path.posix.relative(config.root, id);
67
+ const idStable = path.posix.relative(userRootDir, id);
67
68
  // Don't remove `?` queries because each `id` should belong to a unique bundle.
68
69
  const hash = getIdHash(idStable);
69
70
  return `${name}-${hash}`;
@@ -71,13 +72,18 @@ function distFileNames() {
71
72
  else {
72
73
  let name;
73
74
  const isVirtualModule = id.match(/virtual:([^:]+):/);
74
- if (!isVirtualModule) {
75
- name = 'style';
76
- }
77
- else {
75
+ if (isVirtualModule) {
78
76
  name = isVirtualModule[1];
79
77
  assert(name);
80
78
  }
79
+ else if (
80
+ // https://github.com/vikejs/vike/issues/1818#issuecomment-2298478321
81
+ id.startsWith('/__uno')) {
82
+ name = 'uno';
83
+ }
84
+ else {
85
+ name = 'style';
86
+ }
81
87
  const hash = getIdHash(id);
82
88
  return `${name}-${hash}`;
83
89
  }
@@ -1 +1 @@
1
- export declare const PROJECT_VERSION: "0.4.189";
1
+ export declare const PROJECT_VERSION: "0.4.190";
@@ -1,2 +1,2 @@
1
1
  // Automatically updated by @brillout/release-me
2
- export const PROJECT_VERSION = '0.4.189';
2
+ export const PROJECT_VERSION = '0.4.190';
@@ -1,4 +1,4 @@
1
1
  export declare const projectInfo: {
2
2
  projectName: "Vike";
3
- projectVersion: "0.4.189";
3
+ projectVersion: "0.4.190";
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vike",
3
- "version": "0.4.189",
3
+ "version": "0.4.190",
4
4
  "scripts": {
5
5
  "dev": "tsc --watch",
6
6
  "build": "rimraf dist/ && pnpm run build:esm && pnpm run build:cjs",