Skip to content

Commit

Permalink
fix: do not insert newline if style is already minified
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 11, 2018
1 parent 0d52d86 commit 2603ee2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/stylePlugins/trim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import * as postcss from 'postcss'
export default postcss.plugin('trim', () => (css: Root) => {
css.walk(({ type, raws }) => {
if (type === 'rule' || type === 'atrule') {
raws.before = raws.after = '\n'
if (raws.before) raws.before = '\n'
if (raws.after) raws.after = '\n'
}
})
})

0 comments on commit 2603ee2

Please sign in to comment.