Skip to content

Commit

Permalink
chore: defu added
Browse files Browse the repository at this point in the history
  • Loading branch information
rrd108 committed Mar 10, 2024
1 parent 82a797a commit 3cee26e
Show file tree
Hide file tree
Showing 3 changed files with 175 additions and 117 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
},
"dependencies": {
"@nuxt/kit": "^3.10.3",
"@prisma/client": "5.10.2"
"@prisma/client": "5.10.2",
"defu": "^6.1.4"
},
"devDependencies": {
"@nuxt/devtools": "latest",
Expand Down
6 changes: 5 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
createResolver,
addServerHandler,
} from "@nuxt/kit";
import defu from "defu";

// Module options TypeScript interface definition
export interface ModuleOptions {
Expand Down Expand Up @@ -37,7 +38,10 @@ export default defineNuxtModule<ModuleOptions>({
handler: resolver.resolve("./runtime/server/middleware/tokenAuth"),
});

nuxt.options.runtimeConfig.public.nuxtTokenAuthentication = options;
nuxt.options.runtimeConfig.public.nuxtTokenAuthentication = defu(
nuxt.options.runtimeConfig.public.nuxtTokenAuthentication,
options
);

// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
addPlugin(resolver.resolve("./runtime/plugin"));
Expand Down
Loading

0 comments on commit 3cee26e

Please sign in to comment.