davidguttman / cssify

Simple middleware for Browserify to add css styles to the browser.
122 stars 19 forks source link

es6 const syntax #31

Closed thaiat closed 8 years ago

thaiat commented 8 years ago

When upgrading to the latest (1.0.0) of cssify, i get an syntax error in : https://github.com/davidguttman/cssify/blob/master/lib/index.js#L3

const through = require('through2')
^^^^^
SyntaxError: Use of const in strict mode.

Any idea what's going on ?

faergeek commented 8 years ago

Which version of node do you have?

thaiat commented 8 years ago

0.12

i unserstand that you changed the constraint to node >= 4.0 but do you really need that ? const could be easily replace by var and es6 template string rewritten

this would give broader audience to your very useful transform ....

faergeek commented 8 years ago

Would you like to submit a PR for this change? :-)

noahmatisoff commented 8 years ago

+1 same problem.

faergeek commented 8 years ago

@matisoffn @thaiat I would like to fix it, but I'm too busy currently, would you like to submit a pull request to fix it?

noahmatisoff commented 8 years ago

Just swap const with var in the lib dir?

faergeek commented 8 years ago

No, Not just s/const/var, there are arrow functions and other features of ES6.

noahmatisoff commented 8 years ago

I don't know ES6 well enough, but I'll try and submit a PR.

faergeek commented 8 years ago

Ok, I'll help a bit if you need it.

noahmatisoff commented 8 years ago

Can someone please handle this if they get the chance?

faergeek commented 8 years ago

I'll submit a PR. I've got some time now :-)

faergeek commented 8 years ago

@matisoffn @thaiat Could you test my branch? I just tested with 0.12.0 and it works