Skip to content

Commit

Permalink
fix: minify js
Browse files Browse the repository at this point in the history
Fixes #43
  • Loading branch information
harlan-zw committed Jul 3, 2024
1 parent 7c4b415 commit 5bd02bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/runtime/nitro-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { createFilter } from './util'
import { debug, exclude, include, mode, replayScript, script } from '#nuxt-delay-hydration/api'
import { useRuntimeConfig } from '#imports'

const SCRIPT_REGEX = /<script(.*?)>/gm
const SCRIPT_REGEX = /<script(.*?)>/g

export default defineNitroPlugin((nitro) => {
const filter = createFilter({ include, exclude })
Expand Down Expand Up @@ -81,6 +81,6 @@ export default defineNitroPlugin((nitro) => {
${debug ? 'w._$delayHydration.then((e) => { console.log(\'[nuxt-delay-hydration] Hydration event\', e) })' : ''}
${extraScripts}
})();
</script>`)
</script>`.replace(/\s+/g, ' ').replace(/[\n\r]/g, ''))
})
})

0 comments on commit 5bd02bf

Please sign in to comment.