@tsrx/vite-plugin-vue 0.0.26 → 0.0.27
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.
- package/package.json +1 -1
- package/src/index.js +5 -7
package/package.json
CHANGED
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
|
-
|
|
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
|
-
|
|
186
|
-
if (
|
|
187
|
-
|
|
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
|
|
191
|
+
return { code, map };
|
|
194
192
|
},
|
|
195
193
|
|
|
196
194
|
handleHotUpdate(ctx) {
|