@icvdeveloper/common-module 0.0.20 → 0.0.21

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
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.0.20"
7
+ "version": "0.0.21"
8
8
  }
package/dist/module.mjs CHANGED
@@ -2,7 +2,6 @@ import { join, resolve } from 'path';
2
2
  import { fileURLToPath } from 'url';
3
3
  import { defineNuxtModule, useLogger, installModule, addPlugin, addAutoImportDir, addComponentsDir } from '@nuxt/kit';
4
4
  import svgLoader from 'vite-svg-loader';
5
- import { find, remove } from 'lodash-es';
6
5
 
7
6
  // -- Unbuild CommonJS Shims --
8
7
  import __cjs_url__ from 'url';
@@ -149,14 +148,24 @@ const module = defineNuxtModule({
149
148
  extensions: ["vue"],
150
149
  prefix: "Common"
151
150
  });
152
- nuxt.hook("app:resolve", (nuxt2) => {
153
- const piniaRuntime = find(nuxt2.plugins, (object) => {
154
- return object.src.includes("@pinia");
151
+ nuxt.hook("app:resolve", async (nuxt2) => {
152
+ let index = 0;
153
+ const piniaRuntime = nuxt2.plugins.find((object, i) => {
154
+ const containsPinia = object.src.includes("@pinia");
155
+ if (containsPinia) {
156
+ index = i;
157
+ return true;
158
+ } else {
159
+ return false;
160
+ }
155
161
  });
156
- nuxt2.plugins = remove(nuxt2.plugins, (object) => {
157
- return !object.src.includes("@pinia");
158
- });
159
- nuxt2.plugins.unshift(piniaRuntime);
162
+ if (piniaRuntime) {
163
+ nuxt2.plugins.splice(index, 1);
164
+ nuxt2.plugins.unshift(piniaRuntime);
165
+ console.log(nuxt2.plugins);
166
+ } else {
167
+ console.warn("[V3plus Common Module]: Could not find Pinia");
168
+ }
160
169
  });
161
170
  }
162
171
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.20",
3
+ "version": "0.0.21",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {