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

postcss does not work as expected with vue-loader #1395

Closed
JounQin opened this issue Sep 3, 2018 · 7 comments
Closed

postcss does not work as expected with vue-loader #1395

JounQin opened this issue Sep 3, 2018 · 7 comments

Comments

@JounQin
Copy link

JounQin commented Sep 3, 2018

Version

15.4.0

Reproduction link

JounQin/test@ba578d3

Steps to reproduce

Clone https://github.com/JounQin/test and checkout branch vue-loader, run yarn build and check dist/main.*.css file, it is minified. Change code back to Vue style version and run yarn build again, dist/main.*.css is not minified correctly.

What is expected?

dist/main.*.css should be minified.

What is actually happening?

dist/main.*.css is not minified.

@JounQin
Copy link
Author

JounQin commented Sep 4, 2018

I find out it is caused by https://github.com/vuejs/component-compiler-utils/blob/master/lib/stylePlugins/trim.ts#L7.

It is named trim, should it be raws.before = raws.after = ''?

@yyx990803 @Jinjiang @blake-newman Please help...

@JounQin
Copy link
Author

JounQin commented Dec 4, 2018

It seems @yyx990803 you have came back to 'work', would like to check about this issue?

@TheAlexLichter
Copy link

TheAlexLichter commented Dec 5, 2018

I'd love to see progress as well ☺️

Related PR (merged but didn't solve the problem AFAIK): vuejs/component-compiler-utils#36

@TheAlexLichter
Copy link

@JounQin Could you change the title of the PR to something more descriptive? 🤔

@yyx990803
Copy link
Member

yyx990803 commented Dec 11, 2018

I just ran your reproduction and can't seem to reproduce the problem. I'm not sure how your repo even is related to vue-loader since it's importing a .scss file which not handled by vue-loader at all.

Also not able to reproduce the minification issue via vue-cli, so I assume this has something to do with your specific setup, but I don't know what the problem is without proper reproduction.

@yyx990803
Copy link
Member

yyx990803 commented Dec 11, 2018

FYI, the trim plugin has always worked like that for over a year. This has never been a problem and unlikely to be the root cause.

I just ran the repro from cssnano/cssnano#586 and it also minifies properly, so this is likely already fixed in some related dependency which originally caused the problem, unless a proper reproduction can be provided.

@yyx990803
Copy link
Member

yyx990803 commented Dec 11, 2018

I was able to reproduce this via Vue CLI as I noticed this only happens for CSS inlined in JavaScript. Let's track this in vuejs/component-compiler-utils#40 instead.

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 a pull request may close this issue.

3 participants