Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(trim): don't insert line break #40

Closed
wants to merge 2 commits into from
Closed

Conversation

manniL
Copy link

@manniL manniL commented Dec 11, 2018

Currently the component CSS is separated by a line break (caused by the trim stylePlugin).
Though this can be helpful for debugging, the characters are not necessary at all (at least from what I know).

Current state

image

With fix

image

Related issues and PRs

#36
vuejs/vue-loader#1395
cssnano/cssnano#586
nuxt/nuxt#4311

@yyx990803
Copy link
Member

@yyx990803
Copy link
Member

Ok, so the original intention for the trim plugin was to remove the whitespace around the CSS because it is extracted from the <style> section inside a Vue file (with other parts of the Vue file padded as blank lines to preserve proper line numbers).

Always setting it to an empty string will make the dynamic inserted CSS in development harder to read. So in 2603ee2 I've made it so that it only sets it to a newline when the whitespace has not been already trimmed (e.g. by cssnano).

@yyx990803 yyx990803 closed this Dec 11, 2018
@yyx990803
Copy link
Member

Fix is out in 2.3.1.

@manniL manniL deleted the patch-1 branch December 11, 2018 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants