@tickboxhq/nuxt 0.0.8 → 0.0.9

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,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=3.0.0"
6
6
  },
7
- "version": "0.0.8",
7
+ "version": "0.0.9",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -21,12 +21,17 @@ const tickboxModule = defineNuxtModule({
21
21
  "@@": nuxt.options.rootDir
22
22
  };
23
23
  const resolvedConfigPath = resolveAlias(options.configPath ?? "~/consent.config", aliases);
24
+ const templateFile = `${nuxt.options.buildDir}/tickbox-config.mjs`;
24
25
  addTemplate({
25
26
  filename: "tickbox-config.mjs",
26
27
  write: true,
27
28
  getContents: () => `export { default } from ${JSON.stringify(resolvedConfigPath)}
28
29
  `
29
30
  });
31
+ nuxt.hook("nitro:config", (nitroConfig) => {
32
+ nitroConfig.alias = nitroConfig.alias || {};
33
+ nitroConfig.alias["#tickbox-config"] = templateFile;
34
+ });
30
35
  nuxt.options.build.transpile.push("@tickboxhq/vue", "@tickboxhq/core");
31
36
  addPlugin(resolver.resolve("./runtime/plugin"));
32
37
  addImports([
@@ -1,6 +1,6 @@
1
1
  import { generateAiTxt } from "@tickboxhq/core";
2
2
  import { defineEventHandler, setHeader } from "h3";
3
- import userConfig from "#build/tickbox-config";
3
+ import userConfig from "#tickbox-config";
4
4
  export default defineEventHandler((event) => {
5
5
  const config = userConfig?.default ?? userConfig;
6
6
  setHeader(event, "Content-Type", "text/plain; charset=utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tickboxhq/nuxt",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Nuxt 3/4 module for Tickbox consent management",
5
5
  "license": "MIT",
6
6
  "homepage": "https://tickbox.dev",
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@nuxt/kit": "^3.13.0",
32
- "@tickboxhq/core": "0.0.8",
33
- "@tickboxhq/vue": "0.0.8"
32
+ "@tickboxhq/core": "0.0.9",
33
+ "@tickboxhq/vue": "0.0.9"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "nuxt": "^3.0.0 || ^4.0.0"