@storyblok/nuxt 4.0.0 → 4.0.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.
- package/dist/module.cjs +5 -0
- package/dist/module.d.ts +37 -0
- package/dist/module.json +5 -0
- package/dist/module.mjs +37 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.mjs +7 -0
- package/dist/types.d.ts +6 -0
- package/package.json +3 -2
package/dist/module.cjs
ADDED
package/dist/module.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { defineNuxtModule, addComponentsDir, addPlugin, addAutoImport } from '@nuxt/kit';
|
|
4
|
+
|
|
5
|
+
// -- Unbuild CommonJS Shims --
|
|
6
|
+
import __cjs_url__ from 'url';
|
|
7
|
+
import __cjs_path__ from 'path';
|
|
8
|
+
import __cjs_mod__ from 'module';
|
|
9
|
+
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = __cjs_path__.dirname(__filename);
|
|
11
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var module = defineNuxtModule({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "@storyblok/nuxt-beta",
|
|
17
|
+
configKey: "storyblok"
|
|
18
|
+
},
|
|
19
|
+
defaults: {},
|
|
20
|
+
setup(options, nuxt) {
|
|
21
|
+
const axiosIndex = nuxt.options.build.transpile.indexOf("axios");
|
|
22
|
+
if (axiosIndex !== -1) {
|
|
23
|
+
nuxt.options.build.transpile.splice(axiosIndex, 1);
|
|
24
|
+
}
|
|
25
|
+
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
|
|
26
|
+
nuxt.options.vite.optimizeDeps.include.push("axios");
|
|
27
|
+
addComponentsDir({ path: "~/storyblok", global: true, pathPrefix: false });
|
|
28
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
29
|
+
nuxt.options.build.transpile.push(runtimeDir);
|
|
30
|
+
nuxt.options.runtimeConfig.public.storyblok = options;
|
|
31
|
+
addPlugin(resolve(__dirname, "runtime", `./plugin`));
|
|
32
|
+
const names = ["useStoryblok", "useStoryblokApi", "useStoryblokBridge"];
|
|
33
|
+
names.forEach((name) => addAutoImport({ name, as: name, from: "@storyblok/vue" }));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { module as default };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
import { defineNuxtModule, addComponentsDir, addPlugin, addAutoImport } from '@nuxt/kit';
|
|
4
|
+
|
|
5
|
+
// -- Unbuild CommonJS Shims --
|
|
6
|
+
import __cjs_url__ from 'url';
|
|
7
|
+
import __cjs_path__ from 'path';
|
|
8
|
+
import __cjs_mod__ from 'module';
|
|
9
|
+
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = __cjs_path__.dirname(__filename);
|
|
11
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
const module = defineNuxtModule({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "@storyblok/nuxt-beta",
|
|
17
|
+
configKey: "storyblok"
|
|
18
|
+
},
|
|
19
|
+
defaults: {},
|
|
20
|
+
setup(options, nuxt) {
|
|
21
|
+
const axiosIndex = nuxt.options.build.transpile.indexOf("axios");
|
|
22
|
+
if (axiosIndex !== -1) {
|
|
23
|
+
nuxt.options.build.transpile.splice(axiosIndex, 1);
|
|
24
|
+
}
|
|
25
|
+
nuxt.options.vite.optimizeDeps.include = nuxt.options.vite.optimizeDeps.include || [];
|
|
26
|
+
nuxt.options.vite.optimizeDeps.include.push("axios");
|
|
27
|
+
addComponentsDir({ path: "~/storyblok", global: true, pathPrefix: false });
|
|
28
|
+
const runtimeDir = fileURLToPath(new URL("./runtime", import.meta.url));
|
|
29
|
+
nuxt.options.build.transpile.push(runtimeDir);
|
|
30
|
+
nuxt.options.runtimeConfig.public.storyblok = options;
|
|
31
|
+
addPlugin(resolve(__dirname, "runtime", `./plugin`));
|
|
32
|
+
const names = ["useStoryblok", "useStoryblokApi", "useStoryblokBridge"];
|
|
33
|
+
names.forEach((name) => addAutoImport({ name, as: name, from: "@storyblok/vue" }));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export { module as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StoryblokVue, apiPlugin } from "@storyblok/vue";
|
|
2
|
+
import { defineNuxtPlugin, useRuntimeConfig } from "#app";
|
|
3
|
+
|
|
4
|
+
export default defineNuxtPlugin(({ vueApp }) => {
|
|
5
|
+
const { storyblok } = useRuntimeConfig();
|
|
6
|
+
vueApp.use(StoryblokVue, { ...storyblok, use: [apiPlugin] });
|
|
7
|
+
});
|
package/dist/types.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/nuxt",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Storyblok Nuxt.js module",
|
|
5
5
|
"main": "./src/module.js",
|
|
6
6
|
"module": "./src/module.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"src"
|
|
14
|
+
"src",
|
|
15
|
+
"dist"
|
|
15
16
|
],
|
|
16
17
|
"repository": "https://github.com/storyblok/storyblok-nuxt",
|
|
17
18
|
"scripts": {
|