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

Dont add postcss loader gratuitously #937

Closed
wants to merge 2 commits into from
Closed

Conversation

trainiac
Copy link

@trainiac trainiac commented Aug 8, 2017

If the user has not configured any special options for postcss within vue loader and has not added any special query params within the lang attribute (i.e. they just declared <style lang="postcss">) then they probably just wanted syntax highlighting, because postcss is already being run on theystyles.

In PostCSS 6 and the latest postcss-loader you get a warning message for not having sourceMaps options for postcss. If you simply enable sourceMaps within your postcss.config.js and don't add lang="postcss" to your style tag, the warning goes away and sourceMaps works. However, doing this results in losing syntax highlighting for your postcss specific syntax. I looked into vue loader and it looks like if all you want is syntax highlighting and postcss is already being run on the styles anyways, then by not adding postcss loader to the raw loader string you can avoid sourceMaps warnings.

This could also be a change for vue syntax highlighting projects. Perhaps as a community syntax highlighters should offfer another attribute that can be used to declare what syntax highlighting to show that isnt directly tied to what webpack loader should get run

If the user has not configured any special options for postcss within vue loader and has not added any special query params within the lang attribute (i.e. they just declared <style lang="postcss">) then they probably just wanted syntax highlighting, because postcss is already being run on they styles.
@blake-newman
Copy link
Member

Closing in favour of: #1055

Thanks for the contribution, there alternative PR handles other valid postcss Lang attributes as well.

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