@vizejs/vite-plugin 0.86.0 → 0.87.0
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.mjs +22 -7
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -351,9 +351,12 @@ function parseCustomMedia(css, map) {
|
|
|
351
351
|
while ((m = re.exec(css)) !== null) map.set(m[1], m[2]);
|
|
352
352
|
}
|
|
353
353
|
function resolveCssPath(importPath, importer, aliasRules) {
|
|
354
|
-
for (const rule of aliasRules)
|
|
355
|
-
const
|
|
356
|
-
|
|
354
|
+
for (const rule of aliasRules) {
|
|
355
|
+
const suffix = matchedAliasSuffix(importPath, rule.find);
|
|
356
|
+
if (suffix !== null) {
|
|
357
|
+
const resolved = path.join(rule.replacement, suffix);
|
|
358
|
+
return path.resolve(resolved);
|
|
359
|
+
}
|
|
357
360
|
}
|
|
358
361
|
if (importPath.startsWith(".")) {
|
|
359
362
|
const dir = path.dirname(importer);
|
|
@@ -362,6 +365,12 @@ function resolveCssPath(importPath, importer, aliasRules) {
|
|
|
362
365
|
if (path.isAbsolute(importPath)) return importPath;
|
|
363
366
|
return null;
|
|
364
367
|
}
|
|
368
|
+
function matchedAliasSuffix(importPath, find) {
|
|
369
|
+
if (importPath === find) return "";
|
|
370
|
+
const prefix = find.endsWith("/") ? find : `${find}/`;
|
|
371
|
+
if (!importPath.startsWith(prefix)) return null;
|
|
372
|
+
return importPath.slice(prefix.length);
|
|
373
|
+
}
|
|
365
374
|
//#endregion
|
|
366
375
|
//#region src/utils/index.ts
|
|
367
376
|
/** Known CSS preprocessor languages that must be delegated to Vite */
|
|
@@ -1303,13 +1312,16 @@ async function transformHook(state, code, id, options) {
|
|
|
1303
1312
|
if (isVizeVirtual(id) || isMacro) {
|
|
1304
1313
|
const realPath = isMacro ? stripVirtualQuery(id) : fromVirtualId(id);
|
|
1305
1314
|
try {
|
|
1306
|
-
const result = await transformWithOxc(code, realPath, {
|
|
1315
|
+
const result = await transformWithOxc(code, realPath, {
|
|
1316
|
+
lang: "ts",
|
|
1317
|
+
sourcemap: false
|
|
1318
|
+
});
|
|
1307
1319
|
const defines = getVirtualModuleDefines(state, options?.ssr ?? false);
|
|
1308
1320
|
let transformed = result.code;
|
|
1309
1321
|
transformed = applyDefineReplacements(transformed, defines);
|
|
1310
1322
|
return {
|
|
1311
1323
|
code: transformed,
|
|
1312
|
-
map:
|
|
1324
|
+
map: null
|
|
1313
1325
|
};
|
|
1314
1326
|
} catch (e) {
|
|
1315
1327
|
state.logger.error(`transformWithOxc failed for ${realPath}:`, e);
|
|
@@ -1449,13 +1461,16 @@ function createPostTransformPlugin(state) {
|
|
|
1449
1461
|
ssr: isSsr,
|
|
1450
1462
|
extractCss: state.extractCss,
|
|
1451
1463
|
filePath: id
|
|
1452
|
-
}), id, {
|
|
1464
|
+
}), id, {
|
|
1465
|
+
lang: "ts",
|
|
1466
|
+
sourcemap: false
|
|
1467
|
+
});
|
|
1453
1468
|
const defines = transformOptions?.ssr ? state.serverViteDefine : state.clientViteDefine;
|
|
1454
1469
|
let transformed = result.code;
|
|
1455
1470
|
if (Object.keys(defines).length > 0) transformed = applyDefineReplacements(transformed, defines);
|
|
1456
1471
|
return {
|
|
1457
1472
|
code: transformed,
|
|
1458
|
-
map:
|
|
1473
|
+
map: null
|
|
1459
1474
|
};
|
|
1460
1475
|
} catch (e) {
|
|
1461
1476
|
state.logger.error(`Virtual SFC compilation failed for ${id}:`, e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"description": "High-performance native Vite plugin for Vue SFC compilation powered by Vize",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"compiler",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@vizejs/native": "0.
|
|
36
|
+
"@vizejs/native": "0.87.0",
|
|
37
37
|
"tinyglobby": "0.2.16",
|
|
38
|
-
"vize": "0.
|
|
38
|
+
"vize": "0.87.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "25.7.0",
|