@bagelink/blox 1.14.7 → 1.14.13
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/vite-plugin.cjs +12 -4
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.mjs +12 -4
- package/package.json +1 -1
package/dist/vite-plugin.cjs
CHANGED
|
@@ -1277,10 +1277,18 @@ function bloxPlugin(options = {}) {
|
|
|
1277
1277
|
remaining = remaining.slice(0, declStart) + remaining.slice(j);
|
|
1278
1278
|
}
|
|
1279
1279
|
const hoistedImports = [];
|
|
1280
|
-
const importRe = /^[ \t]*import\s[
|
|
1281
|
-
remaining = remaining.replace(importRe, (match) => {
|
|
1282
|
-
|
|
1283
|
-
|
|
1280
|
+
const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
|
|
1281
|
+
remaining = remaining.replace(importRe, (match, namedGroup, source) => {
|
|
1282
|
+
const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
|
|
1283
|
+
const hoist = [];
|
|
1284
|
+
const keep = [];
|
|
1285
|
+
for (const name of names) {
|
|
1286
|
+
const local = name.split(/\s+as\s+/).pop().trim();
|
|
1287
|
+
if (identifiers.has(local)) hoist.push(name);
|
|
1288
|
+
else keep.push(name);
|
|
1289
|
+
}
|
|
1290
|
+
if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
|
|
1291
|
+
return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
|
|
1284
1292
|
});
|
|
1285
1293
|
const langMatch = attrs.match(/lang="([^"]+)"/);
|
|
1286
1294
|
const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"vite-plugin.d.ts","sourceRoot":"","sources":["../src/vite-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,MAAM,CAAA;AAM9C,MAAM,WAAW,iBAAiB;IACjC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAA;IACb;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,EAAE,CAsUpE"}
|
package/dist/vite-plugin.mjs
CHANGED
|
@@ -1275,10 +1275,18 @@ function bloxPlugin(options = {}) {
|
|
|
1275
1275
|
remaining = remaining.slice(0, declStart) + remaining.slice(j);
|
|
1276
1276
|
}
|
|
1277
1277
|
const hoistedImports = [];
|
|
1278
|
-
const importRe = /^[ \t]*import\s[
|
|
1279
|
-
remaining = remaining.replace(importRe, (match) => {
|
|
1280
|
-
|
|
1281
|
-
|
|
1278
|
+
const importRe = /^[ \t]*import\s+(\{[^}]*\})\s+from\s+(['"](?:@bagelink\/blox|@bagelink\/vue)['"])\s*;?[ \t]*$/gm;
|
|
1279
|
+
remaining = remaining.replace(importRe, (match, namedGroup, source) => {
|
|
1280
|
+
const names = namedGroup.replace(/[{}]/g, "").split(",").map((n2) => n2.trim()).filter(Boolean);
|
|
1281
|
+
const hoist = [];
|
|
1282
|
+
const keep = [];
|
|
1283
|
+
for (const name of names) {
|
|
1284
|
+
const local = name.split(/\s+as\s+/).pop().trim();
|
|
1285
|
+
if (identifiers.has(local)) hoist.push(name);
|
|
1286
|
+
else keep.push(name);
|
|
1287
|
+
}
|
|
1288
|
+
if (hoist.length) hoistedImports.push(`import { ${hoist.join(", ")} } from ${source}`);
|
|
1289
|
+
return keep.length ? `import { ${keep.join(", ")} } from ${source}` : "";
|
|
1282
1290
|
});
|
|
1283
1291
|
const langMatch = attrs.match(/lang="([^"]+)"/);
|
|
1284
1292
|
const lang = langMatch ? ` lang="${langMatch[1]}"` : "";
|
package/package.json
CHANGED