diff --git a/src/module.ts b/src/module.ts index af71143..c2e2dff 100644 --- a/src/module.ts +++ b/src/module.ts @@ -26,17 +26,13 @@ export default defineNuxtModule>({ nuxt.hook('vite:extendConfig', (config, { isClient }) => { const mode = isClient ? 'client' : 'server' - const sourcemapValue = nuxt.options.sourcemap[mode] - if (typeof sourcemapValue !== 'boolean') { - throw new TypeError(`Expected a boolean for sourcemap[${mode}], but received ${typeof sourcemapValue}.`) - } config.plugins = config.plugins || [] config.plugins.push( transformPlugin.vite({ include: options.include, exclude: options.exclude, - sourcemap: sourcemapValue, + sourcemap: nuxt.options.sourcemap[mode], transformStyles: name => resolveStyles(options, name) }) ) @@ -45,17 +41,13 @@ export default defineNuxtModule>({ nuxt.hook('webpack:config', (configs) => { configs.forEach((config) => { const mode = config.name === 'client' ? 'client' : 'server' - const sourcemapValue = nuxt.options.sourcemap[mode] - if (typeof sourcemapValue !== 'boolean') { - throw new TypeError(`Expected a boolean for sourcemap[${mode}], but received ${typeof sourcemapValue}.`) - } config.plugins = config.plugins || [] config.plugins.push( transformPlugin.webpack({ include: options.include, exclude: options.exclude, - sourcemap: sourcemapValue, + sourcemap: nuxt.options.sourcemap[mode], transformStyles: name => resolveStyles(options, name) }) )