Skip to content

Commit

Permalink
chore!: update to nuxt 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 24, 2022
1 parent 028ea48 commit 4d01321
Show file tree
Hide file tree
Showing 3 changed files with 1,013 additions and 952 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
"test": "yarn lint"
},
"dependencies": {
"@nuxt/kit": "^3.0.0-rc.9",
"@nuxt/kit": "^3.0.0",
"lodash.template": "^4.5.0",
"pathe": "^1.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@nuxt/module-builder": "^0.1.7",
"@nuxt/schema": "^3.0.0-rc.9",
"@nuxt/schema": "^3.0.0",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@types/lodash.template": "^4.5.1",
"@typescript-eslint/parser": "^5.34.0",
"babel-jest": "^29.3.1",
"eslint": "^8.22.0",
"husky": "8.0.1",
"jest": "^29.3.1",
"nuxt": "npm:nuxt3@latest",
"nuxt": "3.0.0",
"standard-version": "^9.5.0",
"typescript": "^4.7.4"
},
Expand Down
5 changes: 4 additions & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export default defineNuxtModule({
}

// Nuxt 2 - SSR false
// @ts-expect-error TODO: add nuxt2 types when merged to bridge
nuxt.hook('vue-renderer:spa:prepareContext', ({ head }) => {
const script = {
hid: options.hid,
Expand All @@ -87,7 +88,9 @@ export default defineNuxtModule({
const createHash = await import('crypto').then(r => r.createHash)

// Nuxt 2 - SSR true
// @ts-expect-error TODO: add nuxt2 types when merged to bridge
nuxt.hook('vue-renderer:ssr:csp', (cspScriptSrcHashes) => {
// @ts-expect-error TODO: add nuxt2 types when merged to bridge
const { csp } = nuxt.options.render
const hash = createHash((csp as any).hashAlgorithm)
hash.update(options.script!)
Expand All @@ -100,7 +103,7 @@ export default defineNuxtModule({
if (nuxt.options.dev) {
const { dst } = addTemplate({
src: scriptPath,
fileName: join('color-mode', 'script.min.js'),
filename: join('color-mode', 'script.min.js'),
options
})
nuxt.hook('webpack:config', (configs) => {
Expand Down
Loading

0 comments on commit 4d01321

Please sign in to comment.