@dyrected/nuxt 2.3.9 → 2.5.6

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/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@dyrected/nuxt",
3
3
  "configKey": "dyrected",
4
- "version": "2.3.8"
4
+ "version": "2.5.5"
5
5
  }
@@ -1,12 +1,20 @@
1
- import { defineNitroPlugin } from "nitro/runtime";
1
+ import { defineNitroPlugin } from "nitropack/runtime";
2
2
  import { useRuntimeConfig } from "#imports";
3
3
  export default defineNitroPlugin(async (nitroApp) => {
4
4
  const runtimeConfig = useRuntimeConfig().dyrected;
5
5
  if (runtimeConfig?.configPath) {
6
6
  try {
7
7
  const configPath = runtimeConfig.configPath;
8
- const { pathToFileURL } = await import("url");
9
- const { default: userConfig } = await import(pathToFileURL(configPath).href);
8
+ let userConfig = null;
9
+ try {
10
+ const { default: jiti } = await import("jiti");
11
+ const loader = jiti(import.meta.url, { esmResolve: true, interopDefault: true });
12
+ userConfig = loader(configPath);
13
+ } catch (err) {
14
+ const { pathToFileURL } = await import("url");
15
+ const imported = await import(pathToFileURL(configPath).href);
16
+ userConfig = imported.default || imported;
17
+ }
10
18
  if (userConfig) {
11
19
  globalThis.__dyrected_config = userConfig;
12
20
  if (userConfig.db) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyrected/nuxt",
3
- "version": "2.3.9",
3
+ "version": "2.5.6",
4
4
  "type": "module",
5
5
  "main": "./dist/module.mjs",
6
6
  "types": "./dist/module.d.ts",
@@ -10,10 +10,10 @@
10
10
  "dependencies": {
11
11
  "@nuxt/kit": "^3.11.2",
12
12
  "h3": "^1.15.0",
13
- "@dyrected/admin": "2.5.3",
14
- "@dyrected/sdk": "2.4.6",
15
- "@dyrected/core": "2.5.2",
16
- "@dyrected/vue": "2.5.5"
13
+ "@dyrected/admin": "2.5.6",
14
+ "@dyrected/core": "2.5.6",
15
+ "@dyrected/sdk": "2.5.6",
16
+ "@dyrected/vue": "2.5.6"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "nuxt": "^3.0.0",