vite-plugin-blocklet 0.9.0 → 0.9.1
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 +4 -1
- package/libs/embed.js +4 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -516,6 +516,10 @@ function createEmbedPlugin(options) {
|
|
|
516
516
|
});
|
|
517
517
|
}
|
|
518
518
|
|
|
519
|
+
if (inputEmbeds.length === 0) {
|
|
520
|
+
return [];
|
|
521
|
+
}
|
|
522
|
+
|
|
519
523
|
return [
|
|
520
524
|
{
|
|
521
525
|
name: 'blocklet:embed:serve',
|
|
@@ -528,7 +532,6 @@ function createEmbedPlugin(options) {
|
|
|
528
532
|
}
|
|
529
533
|
const entryId = ufo.parseURL(id).pathname;
|
|
530
534
|
const embedInput = embedList.find((x) => ufo.joinURL(ufo.withLeadingSlash(x.output), ENTRY_FILE) === entryId);
|
|
531
|
-
console.log('embedInput', embedInput);
|
|
532
535
|
if (embedInput?.entry) {
|
|
533
536
|
const resolution = await this.resolve(embedInput.entry, importer, options);
|
|
534
537
|
return ufo.withQuery(resolution.id, { [PROXY_SUFFIX]: '' });
|
package/libs/embed.js
CHANGED
|
@@ -41,6 +41,10 @@ export default function createEmbedPlugin(options) {
|
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
if (inputEmbeds.length === 0) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
return [
|
|
45
49
|
{
|
|
46
50
|
name: 'blocklet:embed:serve',
|
|
@@ -53,7 +57,6 @@ export default function createEmbedPlugin(options) {
|
|
|
53
57
|
}
|
|
54
58
|
const entryId = parseURL(id).pathname;
|
|
55
59
|
const embedInput = embedList.find((x) => joinURL(withLeadingSlash(x.output), ENTRY_FILE) === entryId);
|
|
56
|
-
console.log('embedInput', embedInput);
|
|
57
60
|
if (embedInput?.entry) {
|
|
58
61
|
const resolution = await this.resolve(embedInput.entry, importer, options);
|
|
59
62
|
return withQuery(resolution.id, { [PROXY_SUFFIX]: '' });
|