vite-plugin-mirrorstate 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -147,16 +147,18 @@ export function mirrorStatePlugin(options = {}) {
147
147
  });
148
148
  },
149
149
  resolveId(id) {
150
- if (id === "virtual:mirrorstate/config" ||
151
- id === "virtual:mirrorstate/initial-states") {
152
- return id;
150
+ if (id === "virtual:mirrorstate/config") {
151
+ return "\0" + id;
152
+ }
153
+ if (id === "virtual:mirrorstate/initial-states") {
154
+ return "\0" + id;
153
155
  }
154
156
  },
155
157
  load(id) {
156
- if (id === "virtual:mirrorstate/config") {
158
+ if (id === "\0virtual:mirrorstate/config") {
157
159
  return `export const WS_PATH = "${opts.path}";`;
158
160
  }
159
- if (id === "virtual:mirrorstate/initial-states") {
161
+ if (id === "\0virtual:mirrorstate/initial-states") {
160
162
  // During build, read all mirror files and inline them
161
163
  const pattern = Array.isArray(opts.filePattern)
162
164
  ? opts.filePattern
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-mirrorstate",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Vite plugin for bidirectional state synchronization through *.mirror.json files",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",