Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Add targetExtension; add support for postcss-brunch #135

Merged
merged 1 commit into from
Jan 20, 2017

Conversation

lydell
Copy link
Contributor

@lydell lydell commented Jan 19, 2017

Fixes #124.
Fixes brunch/postcss-brunch#31.
Closes brunch/postcss-brunch#33.
Fixes brunch/brunch#1619.

HOWEVER:

I had to make the following change to postcss-brunch when testing:

diff --git a/index.js b/index.js
index 6c49ab4..bfe011b 100644
--- a/index.js
+++ b/index.js
@@ -60,7 +60,7 @@ class PostCSSCompiler {
 			file.data = '';
 		}
 		if (file.map) {
-			opts.map.prev = file.map.toJSON();
+			opts.map.prev = file.map.toJSON ? file.map.toJSON() : file.map;
 		}
 
 		return this.processor.process(file.data, opts).then(result => {

file.map was somehow a raw JavaScript object, not a SourceMapGenerator as are always (as far as I know) passed to plugins. I guess this needs to be fixed in brunch – it shouldn't pass anything other than SourceMapGenerators to plugins, should it?

@paulmillr paulmillr merged commit 5f28c3f into brunch:master Jan 20, 2017
@lydell
Copy link
Contributor Author

lydell commented Jan 20, 2017

@paulmillr @shvaikalesh Please note the big HOWEVER. Do you want me to open a new issue?

@lydell lydell deleted the target-extension branch January 20, 2017 06:19
@shvaikalesh
Copy link
Contributor

Hey @lydell. Thanks for the PR, no issue is necessary, I will check that out after brunch/brunch issues. I've tried to move Brunch's website to targetExtension, by got errors from sass in dev mode. Most likely, because of source maps.

@shvaikalesh
Copy link
Contributor

file.map was somehow a raw JavaScript object, not a SourceMapGenerator as are always (as far as I know) passed to plugins. I guess this needs to be fixed in brunch – it shouldn't pass anything other than SourceMapGenerators to plugins, should it?

Not sure, will see.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Brunch + Sass + postcss? Allow adding postcss preprocessors Doesn't seem to work
3 participants