Skip to content

Add sourcemap option to postCSS-loader options #1039

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

Merged
merged 3 commits into from
Nov 11, 2017

Conversation

LinusBorg
Copy link
Contributor

No description provided.

Copy link
Contributor

@Tirke Tirke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the correct syntax I think.
Maybe change the var in const ?

The warning from postcss-loader is still there. Setting cssSourceMap to true in dev config did the trick but I don't think we want to set this one to true by default ...

I looked around a little bit and this warning is common for people using vue-loader.
See the comment from Evan at the bottom of this thread.

There's no need to use postcss-loader with vue-loader. Just use vue-loader' own postcss option.

But maybe it was added to process css files outside of *.vue files ?

@LinusBorg
Copy link
Contributor Author

LinusBorg commented Nov 10, 2017

Hm, thanks for testing it out - vuejs/vue-loader#937 might also be of interest, but:

  1. Evan's comment doesn't really apply because the current code applies postcss-loader only to the loaders for style files (*.css etc.), not the loaders for <style> blocks in .vue files.

  2. While the fix in Dont add postcss loader gratuitously vuejs/vue-loader#937 seems valid to me, it only applies to scenarios where people use <style lang="postcss"> without having explicitly specified a loader for that lang with vue-loader. In our template, we do explicitly define a loader for postcss blocks, and it doesn't include poscss-loader.

Seems some digging will be necessary to make this work. A job for the weekend.

@LinusBorg
Copy link
Contributor Author

@Tirke I found the issue - it was another mistake in the original PR, a strict false comparison even though options.usePostCSS is undefinedwhen creating the loaders for vue-loader.

That resulted in postss-loader being included where it shouldn't.

The fix I just pushed should solve this.

@LinusBorg LinusBorg merged commit 1cbcde1 into develop Nov 11, 2017
Copy link
Contributor

@Tirke Tirke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may have forgotten to use constinstead of var for the postcssLoader variable.
Otherwise all good for me, no more warnings, working as expected.

@LinusBorg
Copy link
Contributor Author

Good eye, but that's cosmetics. Will add this later.

@LinusBorg LinusBorg added this to the 1.2.0 milestone Nov 12, 2017
@LinusBorg LinusBorg deleted the add-sourcemap-to-postccs branch November 14, 2017 12:33
frandiox pushed a commit to OnsenUI/vue-cordova-webpack that referenced this pull request Dec 25, 2017
* Add sourcemap option to postCSS-loader options

* Update utils.js

* fix condition, should als fail on `undefined`
shenron pushed a commit to shenron/webpack that referenced this pull request Mar 20, 2018
* Add sourcemap option to postCSS-loader options

* Update utils.js

* fix condition, should als fail on `undefined`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants