Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with class properties #123

Open
BigAB opened this issue Oct 11, 2017 · 0 comments
Open

Problem with class properties #123

BigAB opened this issue Oct 11, 2017 · 0 comments

Comments

@BigAB
Copy link

BigAB commented Oct 11, 2017

So, when using steal, the stage-2 ES feature Class Properties works with steal in the browser, but fails when building with steal-tools.

Here is a simple recreation gist:
https://gist.github.com/anonymous/bd71f1e976b0cc568f1bdd36efea506b

Simply clone and run steal-tools (assuming you have steal-tools installed globally)

You will get an error like this:
image

OPENING: ~/steal-tools-and-class-properties/package.json!npm
Transpiling...
ERROR: Unable to transpile [email protected]#index: 

unknown: Missing class properties transform.
  1 | class Thing {
> 2 | 	foo = () => {}
    | 	^
  3 | }
  4 | 
  5 | export default Thing
ERROR: 
Build failed

Which is weird in it's own right, but to add to the crazyness, all you need to do is add some config to the steal field in the package.json

{
  "name": "steal-tools-and-class-properties",
  "version": "0.0.1",
  "main": "index.js",
  "dependencies": {
    "steal-tools": "^1.9.1"
  },
  "steal": {
    "babelOptions": {
      "plugins": ["transform-class-properties"]
    }
  }
}

...and that FIXES it!

Weird huh?

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

No branches or pull requests

1 participant