@tsrx/vite-plugin-vue 0.0.26 → 0.0.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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/index.js +5 -7
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vite plugin for @tsrx/vue (.tsrx modules)",
4
4
  "license": "MIT",
5
5
  "author": "Dominic Gannaway",
6
- "version": "0.0.26",
6
+ "version": "0.0.28",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -20,7 +20,7 @@
20
20
  }
21
21
  },
22
22
  "dependencies": {
23
- "@tsrx/vue": "0.1.11"
23
+ "@tsrx/vue": "0.1.12"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "vite": "*",
@@ -31,7 +31,7 @@
31
31
  "vite": "^8.0.12",
32
32
  "vue": "3.6.0-beta.12",
33
33
  "vue-jsx-vapor": "^3.2.14",
34
- "@tsrx/core": "0.1.11"
34
+ "@tsrx/core": "0.1.12"
35
35
  },
36
36
  "files": [
37
37
  "src",
package/src/index.js CHANGED
@@ -176,21 +176,19 @@ function create_tsrx_vue_plugin(options) {
176
176
 
177
177
  const realPath = toRealPath(id.split('?')[0]);
178
178
  const source = await readFile(realPath, 'utf-8');
179
- const { code, css, map } = compile(source, realPath);
179
+ let { code, css, map } = compile(source, realPath);
180
180
 
181
- let finalCode = code;
182
- let finalMap = /** @type {any} */ (map);
183
181
  if (css) {
184
182
  cssCache.set(realPath, css);
185
- finalCode = `import ${JSON.stringify(realPath + CSS_QUERY)};\n${code}`;
186
- if (finalMap && typeof finalMap.mappings === 'string') {
187
- finalMap = { ...finalMap, mappings: ';' + finalMap.mappings };
183
+ code = `import ${JSON.stringify(realPath + CSS_QUERY)};\n${code}`;
184
+ if (map && typeof map.mappings === 'string') {
185
+ map = { ...map, mappings: ';' + map.mappings };
188
186
  }
189
187
  } else {
190
188
  cssCache.delete(realPath);
191
189
  }
192
190
 
193
- return { code: finalCode, map: finalMap };
191
+ return { code, map };
194
192
  },
195
193
 
196
194
  handleHotUpdate(ctx) {