vite-plugin-qingkuai 1.0.18 → 1.0.19
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/dist/index.cjs +13 -19
- package/dist/index.js +13 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -295,15 +295,9 @@ function qingkuai() {
|
|
|
295
295
|
})
|
|
296
296
|
};
|
|
297
297
|
}
|
|
298
|
-
const inputMap = sourcemap ? {
|
|
299
|
-
version: 3,
|
|
300
|
-
sources: [id],
|
|
301
|
-
sourcesContent: [src],
|
|
302
|
-
mappings: compileRes.mappings
|
|
303
|
-
} : void 0;
|
|
304
|
-
const transformWithEsbuild = vite__namespace.transformWithEsbuild;
|
|
305
298
|
const transformWithOxc = vite__namespace.transformWithOxc;
|
|
306
|
-
const
|
|
299
|
+
const transformWithEsbuild = vite__namespace.transformWithEsbuild;
|
|
300
|
+
const tsCompileRes = await (transformWithOxc ?? transformWithEsbuild)(
|
|
307
301
|
compiledCode,
|
|
308
302
|
id,
|
|
309
303
|
{
|
|
@@ -311,23 +305,23 @@ function qingkuai() {
|
|
|
311
305
|
loader: "ts",
|
|
312
306
|
target: "esnext"
|
|
313
307
|
},
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
},
|
|
322
|
-
inputMap
|
|
323
|
-
) : null;
|
|
308
|
+
sourcemap ? {
|
|
309
|
+
version: 3,
|
|
310
|
+
sources: [id],
|
|
311
|
+
sourcesContent: [src],
|
|
312
|
+
mappings: compileRes.mappings
|
|
313
|
+
} : void 0
|
|
314
|
+
);
|
|
324
315
|
if (!tsCompileRes) {
|
|
325
316
|
this.error("Current Vite runtime does not provide TypeScript transform APIs.");
|
|
326
317
|
}
|
|
327
318
|
if (!sourcemap) {
|
|
328
319
|
return tsCompileRes.code;
|
|
329
320
|
}
|
|
330
|
-
|
|
321
|
+
let transformedMap = tsCompileRes.map;
|
|
322
|
+
if (typeof tsCompileRes.map === "string") {
|
|
323
|
+
transformedMap = JSON.parse(tsCompileRes.map);
|
|
324
|
+
}
|
|
331
325
|
return {
|
|
332
326
|
code: tsCompileRes.code,
|
|
333
327
|
map: Object.assign(baseMap, {
|
package/dist/index.js
CHANGED
|
@@ -274,15 +274,9 @@ function qingkuai() {
|
|
|
274
274
|
})
|
|
275
275
|
};
|
|
276
276
|
}
|
|
277
|
-
const inputMap = sourcemap ? {
|
|
278
|
-
version: 3,
|
|
279
|
-
sources: [id],
|
|
280
|
-
sourcesContent: [src],
|
|
281
|
-
mappings: compileRes.mappings
|
|
282
|
-
} : void 0;
|
|
283
|
-
const transformWithEsbuild = vite.transformWithEsbuild;
|
|
284
277
|
const transformWithOxc = vite.transformWithOxc;
|
|
285
|
-
const
|
|
278
|
+
const transformWithEsbuild = vite.transformWithEsbuild;
|
|
279
|
+
const tsCompileRes = await (transformWithOxc ?? transformWithEsbuild)(
|
|
286
280
|
compiledCode,
|
|
287
281
|
id,
|
|
288
282
|
{
|
|
@@ -290,23 +284,23 @@ function qingkuai() {
|
|
|
290
284
|
loader: "ts",
|
|
291
285
|
target: "esnext"
|
|
292
286
|
},
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
},
|
|
301
|
-
inputMap
|
|
302
|
-
) : null;
|
|
287
|
+
sourcemap ? {
|
|
288
|
+
version: 3,
|
|
289
|
+
sources: [id],
|
|
290
|
+
sourcesContent: [src],
|
|
291
|
+
mappings: compileRes.mappings
|
|
292
|
+
} : void 0
|
|
293
|
+
);
|
|
303
294
|
if (!tsCompileRes) {
|
|
304
295
|
this.error("Current Vite runtime does not provide TypeScript transform APIs.");
|
|
305
296
|
}
|
|
306
297
|
if (!sourcemap) {
|
|
307
298
|
return tsCompileRes.code;
|
|
308
299
|
}
|
|
309
|
-
|
|
300
|
+
let transformedMap = tsCompileRes.map;
|
|
301
|
+
if (typeof tsCompileRes.map === "string") {
|
|
302
|
+
transformedMap = JSON.parse(tsCompileRes.map);
|
|
303
|
+
}
|
|
310
304
|
return {
|
|
311
305
|
code: tsCompileRes.code,
|
|
312
306
|
map: Object.assign(baseMap, {
|