@frontic/nuxt 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/dist/module.mjs +8 -0
  2. package/package.json +1 -1
package/dist/module.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { existsSync, readdirSync } from 'node:fs';
2
+ import { createRequire } from 'node:module';
2
3
  import { dirname, join } from 'node:path';
3
4
  import { fileURLToPath } from 'node:url';
4
5
  import { defineNuxtModule, createResolver, addServerHandler, hasNuxtModule, installModule, addImports, addComponentsDir, addComponentExports } from '@nuxt/kit';
@@ -89,13 +90,20 @@ frontic: { composables: false }
89
90
  );
90
91
  }
91
92
  const clientDirPath = fronticClientDir;
93
+ const piniaEsmPath = anyComposableEnabled ? join(dirname(createRequire(import.meta.url).resolve("pinia/package.json")), "dist/pinia.mjs") : null;
92
94
  nuxt.options.vite ||= {};
93
95
  nuxt.options.vite.resolve ||= {};
94
96
  nuxt.options.vite.resolve.alias ||= {};
95
97
  nuxt.options.vite.resolve.alias["@frontic/stack"] = clientDirPath;
98
+ if (piniaEsmPath) {
99
+ nuxt.options.vite.resolve.alias["pinia"] = piniaEsmPath;
100
+ }
96
101
  nuxt.hook("nitro:config", (nitroConfig) => {
97
102
  nitroConfig.alias ||= {};
98
103
  nitroConfig.alias["@frontic/stack"] = clientDirPath;
104
+ if (piniaEsmPath) {
105
+ nitroConfig.alias["pinia"] = piniaEsmPath;
106
+ }
99
107
  });
100
108
  nuxt.hook("prepare:types", ({ tsConfig }) => {
101
109
  tsConfig.compilerOptions ||= {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontic/nuxt",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Nuxt module for Frontic - data fetching composables with smart caching, page routing, and context management",
5
5
  "license": "MIT",
6
6
  "author": "Frontic",