vite-plugin-qingkuai 1.0.30 → 1.0.31
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 -11
- package/dist/index.js +13 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -32,13 +32,6 @@ function _interopNamespaceDefault(e) {
|
|
|
32
32
|
|
|
33
33
|
var vite__namespace = /*#__PURE__*/_interopNamespaceDefault(vite);
|
|
34
34
|
|
|
35
|
-
function isNumber(v) {
|
|
36
|
-
return typeof v === "number";
|
|
37
|
-
}
|
|
38
|
-
function isUndefined(v) {
|
|
39
|
-
return void 0 === v;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
35
|
async function attachScopeForStyleSelectors(code, hash, sourceFile, map) {
|
|
43
36
|
let error;
|
|
44
37
|
const processedRules = /* @__PURE__ */ new WeakSet();
|
|
@@ -101,6 +94,16 @@ async function attachScopeForStyleSelectors(code, hash, sourceFile, map) {
|
|
|
101
94
|
};
|
|
102
95
|
}
|
|
103
96
|
|
|
97
|
+
function normalizePath(path) {
|
|
98
|
+
return path.replaceAll("\\", "/");
|
|
99
|
+
}
|
|
100
|
+
function isNumber(v) {
|
|
101
|
+
return typeof v === "number";
|
|
102
|
+
}
|
|
103
|
+
function isUndefined(v) {
|
|
104
|
+
return void 0 === v;
|
|
105
|
+
}
|
|
106
|
+
|
|
104
107
|
const globalStyle = "\n" + compiler.util.formatSourceCode(
|
|
105
108
|
`
|
|
106
109
|
/* Injected by vite-plugin-qingkuai */
|
|
@@ -205,9 +208,8 @@ function qingkuai(options = {}) {
|
|
|
205
208
|
}
|
|
206
209
|
if (importer?.endsWith(".qk") && !nodePath.extname(id)) {
|
|
207
210
|
const qingkuaiConfig = getQingkuaiConfig(importer);
|
|
208
|
-
return
|
|
209
|
-
nodePath.dirname(importer),
|
|
210
|
-
id + (qingkuaiConfig.resolveImportExtension ? ".qk" : "")
|
|
211
|
+
return normalizePath(
|
|
212
|
+
nodePath.join(nodePath.dirname(importer), id + (qingkuaiConfig.resolveImportExtension ? ".qk" : ""))
|
|
211
213
|
);
|
|
212
214
|
}
|
|
213
215
|
return id;
|
|
@@ -375,7 +377,7 @@ Caused by: "${fileId}".`;
|
|
|
375
377
|
};
|
|
376
378
|
},
|
|
377
379
|
async transform(src, id) {
|
|
378
|
-
if (!id.endsWith(".qk")) {
|
|
380
|
+
if (!(id = normalizePath(id)).endsWith(".qk")) {
|
|
379
381
|
return;
|
|
380
382
|
}
|
|
381
383
|
try {
|
package/dist/index.js
CHANGED
|
@@ -11,13 +11,6 @@ import { util, compile, isCompileError, ReactivityMode, WhitespaceMode } from 'q
|
|
|
11
11
|
import { SourceMapConsumer } from 'source-map-js';
|
|
12
12
|
import { createConfigResolver, ConfigParsingMessageKind } from 'qingkuai-language-service/config';
|
|
13
13
|
|
|
14
|
-
function isNumber(v) {
|
|
15
|
-
return typeof v === "number";
|
|
16
|
-
}
|
|
17
|
-
function isUndefined(v) {
|
|
18
|
-
return void 0 === v;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
14
|
async function attachScopeForStyleSelectors(code, hash, sourceFile, map) {
|
|
22
15
|
let error;
|
|
23
16
|
const processedRules = /* @__PURE__ */ new WeakSet();
|
|
@@ -80,6 +73,16 @@ async function attachScopeForStyleSelectors(code, hash, sourceFile, map) {
|
|
|
80
73
|
};
|
|
81
74
|
}
|
|
82
75
|
|
|
76
|
+
function normalizePath(path) {
|
|
77
|
+
return path.replaceAll("\\", "/");
|
|
78
|
+
}
|
|
79
|
+
function isNumber(v) {
|
|
80
|
+
return typeof v === "number";
|
|
81
|
+
}
|
|
82
|
+
function isUndefined(v) {
|
|
83
|
+
return void 0 === v;
|
|
84
|
+
}
|
|
85
|
+
|
|
83
86
|
const globalStyle = "\n" + util.formatSourceCode(
|
|
84
87
|
`
|
|
85
88
|
/* Injected by vite-plugin-qingkuai */
|
|
@@ -184,9 +187,8 @@ function qingkuai(options = {}) {
|
|
|
184
187
|
}
|
|
185
188
|
if (importer?.endsWith(".qk") && !nodePath.extname(id)) {
|
|
186
189
|
const qingkuaiConfig = getQingkuaiConfig(importer);
|
|
187
|
-
return
|
|
188
|
-
nodePath.dirname(importer),
|
|
189
|
-
id + (qingkuaiConfig.resolveImportExtension ? ".qk" : "")
|
|
190
|
+
return normalizePath(
|
|
191
|
+
nodePath.join(nodePath.dirname(importer), id + (qingkuaiConfig.resolveImportExtension ? ".qk" : ""))
|
|
190
192
|
);
|
|
191
193
|
}
|
|
192
194
|
return id;
|
|
@@ -354,7 +356,7 @@ Caused by: "${fileId}".`;
|
|
|
354
356
|
};
|
|
355
357
|
},
|
|
356
358
|
async transform(src, id) {
|
|
357
|
-
if (!id.endsWith(".qk")) {
|
|
359
|
+
if (!(id = normalizePath(id)).endsWith(".qk")) {
|
|
358
360
|
return;
|
|
359
361
|
}
|
|
360
362
|
try {
|