@vixt/core 0.5.3 → 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.
@@ -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.filter((f2) => /(?:t|j)s$/.test(f2))) {
131
+ for (const f of files) {
132
132
  const p = path.resolve(m, f);
133
- const module = await import(
134
- /* @vite-ignore */
135
- pathToFileURL(p)
136
- ).then((m2) => m2.default);
137
- modules.push(module);
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
  }
@@ -150,7 +154,7 @@ const config = defineVixtModule({
150
154
  name: name$1,
151
155
  enforce: "pre",
152
156
  config(config2) {
153
- const { rootDir, buildDir, srcDir } = vixt.options;
157
+ const { rootDir, buildDir, srcDir, app } = vixt.options;
154
158
  const defaultAlias = {
155
159
  "@": srcDir,
156
160
  "~": srcDir,
@@ -169,6 +173,7 @@ const config = defineVixtModule({
169
173
  );
170
174
  return {
171
175
  root: rootDir,
176
+ base: app?.baseURL,
172
177
  resolve: {
173
178
  alias: defaultAlias
174
179
  },
@@ -414,7 +419,7 @@ function generatePlugins(vixt) {
414
419
  let i = 0;
415
420
  for (const pluginsDir of pluginsDirs.reverse()) {
416
421
  const files = fs.existsSync(pluginsDir) ? fs.readdirSync(pluginsDir) : [];
417
- for (const f of files.filter((f2) => /(?:t|j)sx?$/.test(f2))) {
422
+ for (const f of files.filter((f2) => /[jt]sx?$/.test(f2))) {
418
423
  const p = path.resolve(pluginsDir, f);
419
424
  const pluginName = `__plugin_${i}`;
420
425
  pluginsImportTemplate += `import ${pluginName} from '${p}'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/core",
3
3
  "type": "module",
4
- "version": "0.5.3",
4
+ "version": "0.5.5",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://soullyoko.github.io/vixt/",