Skip to content

Commit

Permalink
fix: remove newline at end of minified script (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerbuuun authored Jun 24, 2024
1 parent 20a16dc commit 0ccbc5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default defineNuxtModule({
const scriptPath = await resolver.resolve('./script.min.js')
const scriptT = await fsp.readFile(scriptPath, 'utf-8')
type ScriptOption = 'storageKey' | 'preference' | 'globalName' | 'classPrefix' | 'classSuffix' | 'dataValue' | 'fallback'
options.script = scriptT.replace(/<%= options\.([^ ]+) %>/g, (_, option: ScriptOption) => options[option])
options.script = scriptT.replace(/<%= options\.([^ ]+) %>/g, (_, option: ScriptOption) => options[option]).trim()

// Inject options via virtual template
nuxt.options.alias['#color-mode-options'] = addTemplate({
Expand Down

0 comments on commit 0ccbc5c

Please sign in to comment.