cssinjs / css-vendor

Runtime vendor prefixing based on feature detection.
MIT License
67 stars 24 forks source link

Update index.js #4

Closed jasonkuhrt closed 8 years ago

jasonkuhrt commented 8 years ago

This PR makes it possible for users to import like so:

import cssVendor from 'css-vendor'
kof commented 8 years ago

export default should actually already do what you want, did you try?

jasonkuhrt commented 8 years ago

export default should actually already do what you want

Do you mean why I am doing export {} if I already did export default {}? Because the former is required to support JS2015 Import Destructuring.

jasonkuhrt commented 8 years ago

I could do import * as cssVendor from 'css-vendor' but I find this unsatisfactory in part because its not mutually exclusive to supporting the default pattern used in this PR.

kof commented 8 years ago

export default {bla} should work both, with and without destructuring.

jasonkuhrt commented 8 years ago

export default {bla} should work both, with and without destructuring.

You're misinformed. Perhaps because you were using babel 5 which itself was incorrect?

kof commented 8 years ago

this explains a lot.

kof commented 8 years ago

ok just npm run lint it and I will merge

kof commented 8 years ago

Also you could create an exports object to not to duplicate that much:

const exports = {...} export default exports export exports

jasonkuhrt commented 8 years ago

ok just npm run lint it and I will merge

  • [x] Will do.

Also you could create an exports object to not to duplicate that much: export exports

That syntax is not supported, AKA syntax error. It must be in the format of export { a, b, c }.

kof commented 8 years ago

merged

jasonkuhrt commented 8 years ago

@kof Thanks :+1:

kof commented 8 years ago

As you are using this module, https://github.com/jsstyles/jss/issues/167 mb you are interested in working on that issue ...

jasonkuhrt commented 8 years ago

If I get some spare time (unlikely) or direct use-cases I'll try and lend a hand! Thanks for the tip.