Skip to content

Commit

Permalink
Merge pull request #561 from Baroshem/vejja/issue559
Browse files Browse the repository at this point in the history
fix(core): do not remove loggers in dev mode
  • Loading branch information
vejja authored Nov 19, 2024
2 parents 642bfce + f8890af commit 5769795
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@nuxt-themes/docus": "^1.14.7",
"@nuxtjs/plausible": "^1.0.0",
"@nuxtlabs/github-module": "^1.6.3",
"nuxt": "^3.11.2",
"nuxt": "3.11.2",
"nuxt-security": "latest"
},
"resolutions": {
Expand Down
1 change: 0 additions & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export default defineNuxtConfig({
interval: 30000,
headers: true
},
removeLoggers: false,
},

hooks: {
Expand Down
1 change: 1 addition & 0 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
</template>

<script setup lang="ts">
console.log('hello from index should be removed in production')
const { data } = await useAsyncData(async () => await Promise.resolve("Home"));
</script>
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export default defineNuxtModule<ModuleOptions>({
// This method is deprecated and will be removed in the future
addVitePlugin(viteRemove(securityOptions.removeLoggers))

} else {
// Uses the native method by Vite
} else if (!nuxt.options.dev) {
// Uses the native method by Vite, except in dev mode
// Vite can use either esbuild or terser
if (nuxt.options.vite.build?.minify === 'terser') {
// In case of terser, set the drop_console and drop_debugger options
Expand Down

0 comments on commit 5769795

Please sign in to comment.