lionelB / cssnext-brunch

# DEPRECATED. Use postcss-brunch instead.
MIT License
3 stars 2 forks source link

Use brunch's normal sourcemap pipeline #6

Open es128 opened 9 years ago

es128 commented 9 years ago

If you can't easily get the non-inlined sourcemap through cssnext's API, see this example for a way to extract it out of the inlined output:

https://github.com/es128/6to5-brunch/blob/395127b1f00f37bf9285eca2552f5cf6f61d7106/index.js

This will make it play nicer with other sourcemap generating plugins.

MoOx commented 9 years ago

cssnext 0.4.0 allows better control for the sourcemap. This plugin just need to be updated according to that change /cc @lionelB

lionelB commented 9 years ago

Thanks @es128 for the insight. The next version of the plugin ( currently working on it) will allow that.

lionelB commented 9 years ago

@es128 I try what you've done for 6to5 but it's not working correctly for me. it only work for the first file, rules from other files refered styles.css: null Also, when you return the compiled data, do not forget to remove the last line to remove the inlined sourcemap.

es128 commented 9 years ago

I'm not sure I understand what you mean by 'other files'. The compiler operates on one source file at a time. If it behaves differently in subsequent calls to the compiler function then there may be a variable scoping issue or something. I can help debug it if you show me how to reproduce what you've observed.

That's a good point about watching out for the removal of the last line. In my code it should have been taken care of by the slice command, but the 6to5 API changed since then so it isn't relevant in that case anymore anyway.