简体   繁体   中英

how to remove css comments from css file

I am using nextjs + reactjs .I want to remove all css comments present in my css file. For example, a created a simple project for next js. I am using next-purgecss to remove unwanted css but still, it is not removing comments why?

here is my code https://codesandbox.io/s/sharp-jennings-upb7y?file=/next.config.js:73-86 I added a comment in my css file

/*

heloo terr
 */
a {
  background-color: green;
}

It should be removed after using purgecss plugin.Is there any way to remove these comments

在此处输入图片说明

To run code create a new terminal and run npm run dev as it open at 3005 port

在此处输入图片说明

Next.js removes comments in CSS automatically. You don't need an extra configuration or CSS processing packages. Run the project in production mode using npm run build and npm start and comments would be removed from the build.

Generally, in development mode ( next dev ), the build is not optimized for production.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM