Skip to content

Commit

Permalink
fix(css): fix css comment removal
Browse files Browse the repository at this point in the history
fix #1359
  • Loading branch information
yyx990803 committed Jan 5, 2021
1 parent e90ff76 commit 7b9dee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Expand Up @@ -116,7 +116,7 @@ export function cssPlugin(config: ResolvedConfig): Plugin {
} else {
// if build, analyze url() asset reference
// account for comments https://github.com/vitejs/vite/issues/426
css = css.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1')
css = css.replace(/\/\*[\s\S]*?\*\//gm, '')
if (cssUrlRE.test(css)) {
css = await rewriteCssUrls(css, async (url) => {
if (isExternalUrl(url) || isDataUrl(url)) {
Expand Down

0 comments on commit 7b9dee0

Please sign in to comment.