Scrum / postcss-at-rules-variables

PostCss plugin to use CSS Custom Properties in at-rule @each, @for, @if, @else and more...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected token {

plesiecki opened this issue · comments

Hello,

After upgrading to 0.0.23 this plugin fails with node 5.
It looks like this:

postcss-at-rules-variables/lib/index.js:35
        rule.each(({ prop, value }) => {
                   ^
SyntaxError: Unexpected token {

It seems babel configuration miss babel-plugin-transform-es2015-destructuring.

Maybe it works with latest node6 - I'm not sure.

Cheers

@plesiecki Hi, write you OS and full version node 5.
i have tests which passed on node 4,5,6.
maybe you need reinstall all node modules.

rm -rf node_modules && npm i didn't help. After further investigation I noticed that transpiled version of master (after npm run build) and installed module from npm registry are different.

// lib/index.js:35 built locally
rule.each(_ref => {
  let prop = _ref.prop;
  let value = _ref.value;

  propertys[prop] = value;
});
// lib/index.js:35 installed from npm registry
rule.each(({ prop, value }) => {
    propertys[prop] = value;
});

Your test are green because ava transpile your code for you

@plesiecki

After further investigation I noticed that transpiled version of master (after npm run build) and installed module from npm registry are different.

I transpiling and publish from node 6, this is a my stupid mistake.

Your test are green because ava transpile your code for you

You are absolutely right !

P.S Thank you for your feedback, it is very important to me and my product :)

@plesiecki fix and publish.

Let me know when you publish new version

@plesiecki now last version 0.0.24