@gjsify/rolldown-plugin-gjsify 0.4.27 → 0.4.28

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.
@@ -6,6 +6,14 @@
6
6
  // Marking them external would leave bare specifiers in the bundle that the
7
7
  // browser cannot resolve at runtime; instead we resolve them to a virtual
8
8
  // empty ESM module so the bundle is self-contained.
9
+ //
10
+ // Portability note: the `filter: { id: ... }` below is a Rolldown fast-path
11
+ // — Rolldown pre-filters which specifiers reach `handler`. Under Vite (which
12
+ // also runs Rolldown for `build` but does NOT honor the Rolldown-specific
13
+ // hook-level `filter` in every code path, e.g. esbuild dep prebundle or the
14
+ // dev server) the handler may receive ALL ids. The internal guard below makes
15
+ // the plugin correct regardless of whether the filter pre-filtered — it is
16
+ // the load-bearing check; the `filter` is a defense-in-depth optimization.
9
17
  const GJSIMPORTS_VIRTUAL_ID = '\0gjsify-empty-gjs-import';
10
18
  export function gjsImportsEmptyPlugin() {
11
19
  return {
@@ -13,7 +21,13 @@ export function gjsImportsEmptyPlugin() {
13
21
  resolveId: {
14
22
  order: 'pre',
15
23
  filter: { id: /^(@girs\/|gi:\/\/)/ },
16
- handler(_source) {
24
+ handler(source) {
25
+ // Internal guard: do not rely solely on the Rolldown `filter`
26
+ // above (it may not pre-filter under Vite). Only intercept
27
+ // `@girs/*` and `gi://*` specifiers; let everything else fall
28
+ // through to the default resolver chain.
29
+ if (!/^(@girs\/|gi:\/\/)/.test(source))
30
+ return null;
17
31
  return { id: GJSIMPORTS_VIRTUAL_ID };
18
32
  },
19
33
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/rolldown-plugin-gjsify",
3
- "version": "0.4.27",
3
+ "version": "0.4.28",
4
4
  "description": "Rolldown / Rollup / Vite plugin orchestrator for GJS, Node, and Browser targets",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -48,11 +48,11 @@
48
48
  ],
49
49
  "license": "MIT",
50
50
  "dependencies": {
51
- "@gjsify/console": "^0.4.27",
52
- "@gjsify/resolve-npm": "^0.4.27",
53
- "@gjsify/rolldown-plugin-deepkit": "^0.4.27",
54
- "@gjsify/rolldown-plugin-pnp": "^0.4.27",
55
- "@gjsify/vite-plugin-blueprint": "^0.4.27",
51
+ "@gjsify/console": "^0.4.28",
52
+ "@gjsify/resolve-npm": "^0.4.28",
53
+ "@gjsify/rolldown-plugin-deepkit": "^0.4.28",
54
+ "@gjsify/rolldown-plugin-pnp": "^0.4.28",
55
+ "@gjsify/vite-plugin-blueprint": "^0.4.28",
56
56
  "@rollup/pluginutils": "^5.3.0",
57
57
  "acorn": "^8.16.0",
58
58
  "acorn-walk": "^8.3.5",
@@ -60,7 +60,7 @@
60
60
  "lightningcss": "^1.32.0"
61
61
  },
62
62
  "peerDependencies": {
63
- "@gjsify/lightningcss-native": "^0.4.27",
63
+ "@gjsify/lightningcss-native": "^0.4.28",
64
64
  "rolldown": "^1.0.0-rc.18"
65
65
  },
66
66
  "peerDependenciesMeta": {