@icvdeveloper/common-module 0.0.19 → 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 +1 -1
- package/dist/module.mjs +17 -8
- package/package.json +1 -1
package/dist/module.json
CHANGED
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
|
-
|
|
154
|
-
|
|
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
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
});
|