-
Notifications
You must be signed in to change notification settings - Fork 916
Allow vue-loader to user PostCSS options as object and custom syntax #240
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
Conversation
Thanks for the PR! I think it maybe a good idea to mix all options other than postcss: {
plugins: [...],
parser: sugarss
} And it would also work in case any other plugins need different options. |
This is definitively the approach to go for, using the plugin options object makes a lot of sense and it will be more modular at the end. But if you want to respect postcss logic it should be like this:
|
@esiao yeah, that'd be cleaner. Could you update the PR to support that instead? |
@yyx990803 Yeah sure, should we keep the legacy version too? With options.postcss being an array or a function. |
@esiao yes, it seems perfectly feasible to do so and it's good to avoid breaking changes. |
@yyx990803 done. I'm checking if the user provided the options object for postcss and merging it with the one defined because |
Great work! Thanks |
@yyx990803 I pushed an update, there was an error thrown when using sourcemaps but no postcss options, that strangely made it past the verification process. |
Yeah, I've fixed it in 8.5.2.
|
@esiao how did you set the |
In the end I'm using it like this:
And in webpack config
But the syntax highlighting is broken since I'm using SugarSS syntax on what the Atom vue plugin considers as postcss syntax. The solution would be to use a custom lang like |
@esiao thanks, my situation like you ... |
@esiao do I have to override the loader for postcss as you've shown when using |
@wprater no, what I've shown here is the final solution I used on my project, I also had some external postcss files to process. If you want to use postcss with vue-loader all you need to do is pass postcss options to vue config as explained here : |
@esiao I have no issues using postcss. it's just the |
Hello, for people in this thread: Is the current state people have to use For my VSCode extension, I have postcss syntax highlight for Vue SFC. I'd like to have SugarSS too, but if there is no way to tell postcss away from SugarSS it's impossible to write a grammar for it. |
I wanted to use SugarSS with PostCSS with vue-loader. It wasn't possible without modifying the style-rewriter and changing the way options works.
You still can use the
postcss: array of plugins
postcss: function that return array of plugins
or the new one
Allowing the use of sugarss or others syntax as custom postcss syntax with vue loader.