@danielx/civet 0.7.33 → 0.7.35
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/CHANGELOG.md +17 -0
- package/dist/browser.js +467 -227
- package/dist/main.js +467 -227
- package/dist/main.mjs +467 -227
- package/dist/types.d.ts +1 -0
- package/dist/unplugin/unplugin.js +17 -4
- package/dist/unplugin/unplugin.mjs +17 -4
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -57,7 +57,12 @@ var postfixRE = /[?#].*$/s;
|
|
|
57
57
|
var isWindows = import_os.default.platform() === "win32";
|
|
58
58
|
var windowsSlashRE = /\\/g;
|
|
59
59
|
function cleanCivetId(id) {
|
|
60
|
-
|
|
60
|
+
let postfix = "";
|
|
61
|
+
id = id.replace(postfixRE, (match) => {
|
|
62
|
+
postfix = match;
|
|
63
|
+
return "";
|
|
64
|
+
}).replace(/\.[jt]sx$/, "");
|
|
65
|
+
return { id, postfix };
|
|
61
66
|
}
|
|
62
67
|
function tryStatSync(file) {
|
|
63
68
|
try {
|
|
@@ -357,8 +362,16 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
357
362
|
resolveId(id, importer, options2) {
|
|
358
363
|
if (/\0/.test(id))
|
|
359
364
|
return null;
|
|
360
|
-
|
|
361
|
-
|
|
365
|
+
let postfix;
|
|
366
|
+
({ id, postfix } = cleanCivetId(id));
|
|
367
|
+
let ref;
|
|
368
|
+
if (import_path.default.isAbsolute(id)) {
|
|
369
|
+
ref = resolveAbsolutePath(rootDir, id, implicitExtension);
|
|
370
|
+
} else {
|
|
371
|
+
ref = import_path.default.resolve(import_path.default.dirname(importer ?? ""), id);
|
|
372
|
+
}
|
|
373
|
+
;
|
|
374
|
+
let resolvedId = ref;
|
|
362
375
|
if (!resolvedId)
|
|
363
376
|
return null;
|
|
364
377
|
if (!resolvedId.endsWith(".civet")) {
|
|
@@ -372,7 +385,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
372
385
|
if (options2.scan && meta.framework === "vite") {
|
|
373
386
|
resolvedId = `\0${resolvedId}`;
|
|
374
387
|
}
|
|
375
|
-
return resolvedId + outExt;
|
|
388
|
+
return resolvedId + outExt + postfix;
|
|
376
389
|
},
|
|
377
390
|
loadInclude(id) {
|
|
378
391
|
return isCivetTranspiled.test(id);
|
|
@@ -25,7 +25,12 @@ var postfixRE = /[?#].*$/s;
|
|
|
25
25
|
var isWindows = os.platform() === "win32";
|
|
26
26
|
var windowsSlashRE = /\\/g;
|
|
27
27
|
function cleanCivetId(id) {
|
|
28
|
-
|
|
28
|
+
let postfix = "";
|
|
29
|
+
id = id.replace(postfixRE, (match) => {
|
|
30
|
+
postfix = match;
|
|
31
|
+
return "";
|
|
32
|
+
}).replace(/\.[jt]sx$/, "");
|
|
33
|
+
return { id, postfix };
|
|
29
34
|
}
|
|
30
35
|
function tryStatSync(file) {
|
|
31
36
|
try {
|
|
@@ -325,8 +330,16 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
325
330
|
resolveId(id, importer, options2) {
|
|
326
331
|
if (/\0/.test(id))
|
|
327
332
|
return null;
|
|
328
|
-
|
|
329
|
-
|
|
333
|
+
let postfix;
|
|
334
|
+
({ id, postfix } = cleanCivetId(id));
|
|
335
|
+
let ref;
|
|
336
|
+
if (path.isAbsolute(id)) {
|
|
337
|
+
ref = resolveAbsolutePath(rootDir, id, implicitExtension);
|
|
338
|
+
} else {
|
|
339
|
+
ref = path.resolve(path.dirname(importer ?? ""), id);
|
|
340
|
+
}
|
|
341
|
+
;
|
|
342
|
+
let resolvedId = ref;
|
|
330
343
|
if (!resolvedId)
|
|
331
344
|
return null;
|
|
332
345
|
if (!resolvedId.endsWith(".civet")) {
|
|
@@ -340,7 +353,7 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
340
353
|
if (options2.scan && meta.framework === "vite") {
|
|
341
354
|
resolvedId = `\0${resolvedId}`;
|
|
342
355
|
}
|
|
343
|
-
return resolvedId + outExt;
|
|
356
|
+
return resolvedId + outExt + postfix;
|
|
344
357
|
},
|
|
345
358
|
loadInclude(id) {
|
|
346
359
|
return isCivetTranspiled.test(id);
|