Skip to content

Commit 6d3cfa9

Browse files
committed
refactor: Optimize console removal and simplify github-slugger usage
1 parent 6406d00 commit 6d3cfa9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

next.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module.exports = {
33
// othor next config here...
44
compiler: {
5-
removeConsole: true,
5+
removeConsole: process.env.NODE_ENV === 'production' ? true : false,
66
},
77
webpack: config => {
88
config.plugins.push(new VeliteWebpackPlugin())

src/app/categories/[slug]/page.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { blogs as allBlogs } from "@/.velite/generated";
22
import BlogLayoutThree from "@/src/components/Blog/BlogLayoutThree";
33
import Categories from "@/src/components/Blog/Categories";
4-
import GithubSlugger, { slug } from "github-slugger";
4+
import { slug } from "github-slugger";
55

6-
const slugger = new GithubSlugger();
6+
// const slugger = new GithubSlugger();
77

88
export async function generateStaticParams() {
99
const categories = [];
@@ -12,7 +12,7 @@ export async function generateStaticParams() {
1212
allBlogs.map((blog) => {
1313
if (blog.isPublished) {
1414
blog.tags.map((tag) => {
15-
let slugified = slugger.slug(tag);
15+
let slugified = slug(tag);
1616
if (!categories.includes(slugified)) {
1717
categories.push(slugified);
1818
paths.push({ slug: slugified });

0 commit comments

Comments
 (0)