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 59e1734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/css.ts
Original file line number Diff line number Diff line change
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, '$1')
if (cssUrlRE.test(css)) {
css = await rewriteCssUrls(css, async (url) => {
if (isExternalUrl(url) || isDataUrl(url)) {
Expand Down

0 comments on commit 59e1734

Please sign in to comment.