@vixt/core 0.5.4 → 0.5.5
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/node/index.mjs +11 -7
- package/package.json +1 -1
package/dist/node/index.mjs
CHANGED
|
@@ -128,13 +128,17 @@ async function applyLayerModules(layers) {
|
|
|
128
128
|
for (const m of modulesDirs.reverse()) {
|
|
129
129
|
if (fs.existsSync(m)) {
|
|
130
130
|
const files = fs.readdirSync(m);
|
|
131
|
-
for (const f of files
|
|
131
|
+
for (const f of files) {
|
|
132
132
|
const p = path.resolve(m, f);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
try {
|
|
134
|
+
const module = await import(
|
|
135
|
+
/* @vite-ignore */
|
|
136
|
+
pathToFileURL(p)
|
|
137
|
+
).then((m2) => m2.default);
|
|
138
|
+
modules.push(module);
|
|
139
|
+
} catch (error) {
|
|
140
|
+
console.error("[LoadVixtModule Error]:", error);
|
|
141
|
+
}
|
|
138
142
|
}
|
|
139
143
|
}
|
|
140
144
|
}
|
|
@@ -415,7 +419,7 @@ function generatePlugins(vixt) {
|
|
|
415
419
|
let i = 0;
|
|
416
420
|
for (const pluginsDir of pluginsDirs.reverse()) {
|
|
417
421
|
const files = fs.existsSync(pluginsDir) ? fs.readdirSync(pluginsDir) : [];
|
|
418
|
-
for (const f of files.filter((f2) => /
|
|
422
|
+
for (const f of files.filter((f2) => /[jt]sx?$/.test(f2))) {
|
|
419
423
|
const p = path.resolve(pluginsDir, f);
|
|
420
424
|
const pluginName = `__plugin_${i}`;
|
|
421
425
|
pluginsImportTemplate += `import ${pluginName} from '${p}'
|