@marko/runtime-tags 6.3.9 → 6.3.10
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/translator/index.js +7 -4
- package/package.json +1 -1
package/dist/translator/index.js
CHANGED
|
@@ -8854,11 +8854,14 @@ var import_declaration_default = {
|
|
|
8854
8854
|
const tags = importDecl.hub.file.metadata.marko.tags;
|
|
8855
8855
|
if (!tags.includes(tagImport)) tags.push(tagImport);
|
|
8856
8856
|
}
|
|
8857
|
-
const
|
|
8858
|
-
if (
|
|
8859
|
-
(
|
|
8857
|
+
const loadAttrPath = node.attributes?.length ? importDecl.get("attributes").find((p) => (p.node.key.type === "Identifier" ? p.node.key.name : p.node.key.value) === "load") : void 0;
|
|
8858
|
+
if (loadAttrPath) {
|
|
8859
|
+
if (!getMarkoOpts().linkAssets) {
|
|
8860
|
+
loadAttrPath.remove();
|
|
8861
|
+
return;
|
|
8862
|
+
}
|
|
8863
|
+
(node.extra ??= {}).loadImport = getLoadImportConfig(loadAttrPath.get("value"));
|
|
8860
8864
|
const { file } = importDecl.hub;
|
|
8861
|
-
if (!getMarkoOpts().linkAssets) throw importDecl.buildCodeFrameError("The `load` import attribute requires the `linkAssets` compiler option to be configured.");
|
|
8862
8865
|
if (!(tagImport && (0, _marko_compiler_babel_utils.loadFileForImport)(file, value))) throw importDecl.buildCodeFrameError("Unable to resolve marko file for load import.");
|
|
8863
8866
|
if ((node.importKind || "value") !== "value") throw importDecl.buildCodeFrameError("Invalid load import.");
|
|
8864
8867
|
for (const specifier of importDecl.get("specifiers")) if (!_marko_compiler.types.isImportDefaultSpecifier(specifier.node)) throw specifier.buildCodeFrameError("Invalid load import, only a default specifier is allowed.");
|