@daz4126/helium 0.26.0 → 0.28.0
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/helium.js +17 -13
- package/package.json +1 -1
package/helium.js
CHANGED
|
@@ -196,21 +196,25 @@ async function processElements(element) {
|
|
|
196
196
|
|
|
197
197
|
const importPromises = [];
|
|
198
198
|
|
|
199
|
-
heElements.forEach(el => {
|
|
199
|
+
heElements.forEach((el) => {
|
|
200
200
|
const importAttr = el.getAttribute("@import") || el.getAttribute("data-he-import");
|
|
201
201
|
if (importAttr) {
|
|
202
|
-
importAttr.split(",").map(m => m.trim()).forEach(moduleName => {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
202
|
+
importAttr.split(",").map((m) => m.trim()).forEach((moduleName) => {
|
|
203
|
+
importPromises.push(
|
|
204
|
+
import("helium_" + "modules/" + moduleName)
|
|
205
|
+
.then((module) => {
|
|
206
|
+
Object.keys(module).forEach(
|
|
207
|
+
(key) => (state[key] = module[key]),
|
|
208
|
+
);
|
|
209
|
+
})
|
|
210
|
+
.catch((error) => {
|
|
211
|
+
console.error(
|
|
212
|
+
`Failed to import module: ${moduleName}`,
|
|
213
|
+
error.message,
|
|
214
|
+
);
|
|
215
|
+
}),
|
|
216
|
+
);
|
|
217
|
+
});
|
|
214
218
|
}
|
|
215
219
|
});
|
|
216
220
|
|