Skip to content

Commit

Permalink
feat: 禁用生产环境的log和debug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohaodu committed Nov 14, 2023
1 parent 3ab987f commit 881b612
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 0 additions & 1 deletion components/navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const themeStyle = reactive({
});
const { githubAccessDev, githubAccessServe } = useRuntimeConfig().public;
const githubAccess = process.env.NODE_ENV === 'production' ? githubAccessServe : githubAccessDev;
console.log(process.env.NODE_ENV);
const isLogin = ref(false);
let githubUser = ref<GithubUser>();
Expand Down
8 changes: 8 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export default defineNuxtConfig({
vite: {
build: {
assetsInlineLimit: 0, // 图片转 base64 编码的阈值
minify: 'terser',
terserOptions: {
compress: {
//生产环境时移除console.log()
drop_console: true,
drop_debugger: true,
},
},
},
},
app: {
Expand Down
2 changes: 0 additions & 2 deletions server/api/github/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ export default defineEventHandler((event) => {
const { githubAccessDev, githubAccessServe } = useRuntimeConfig().public;
const githubAccess =
process.env.NODE_ENV === 'production' ? githubAccessServe : githubAccessDev;
console.log(process.env.NODE_ENV);

const { data: githubAuth } = await axios({
httpsAgent: new https.Agent({
rejectUnauthorized: false,
Expand Down

0 comments on commit 881b612

Please sign in to comment.