Skip to content

Add babelConfig parameter#5

Open
leiming wants to merge 2 commits into
jxnblk:masterfrom
leiming:master
Open

Add babelConfig parameter#5
leiming wants to merge 2 commits into
jxnblk:masterfrom
leiming:master

Conversation

@leiming

@leiming leiming commented Apr 12, 2016

Copy link
Copy Markdown

babelconfig.json

{
  "plugins": ["transform-decorators-legacy"]
}

We can use the below command in order to using Decorators:

static-react RootComponent.js  -b babelconfig.json > index.html

@jxnblk

jxnblk commented Apr 13, 2016

Copy link
Copy Markdown
Owner

Thanks, but is this even necessary? Won't it pick up a local .babelrc?

@leiming

leiming commented Apr 14, 2016

Copy link
Copy Markdown
Author

The problem of latest master version is static react only register the presets as https://github.com/jxnblk/static-react/blob/master/bin/static-react.js#L4-L8, but ignore the local .babelrc.

For example, my repo has the .babelrc as below:

{
  "presets": ["es2015", "react", "stage-1"],
  "plugins": ["transform-decorators-legacy"]
  }
}

executing static react will throw the error: React.js Decorators are not supported yet in 6.x pending proposal update dispite of having installed babel-plugin-transform-decorators-legacy.

If we pick up .babelrc by static-react -b .babelrc, That's all right! shall we support .babelrc ?

@jxnblk

jxnblk commented Apr 14, 2016

Copy link
Copy Markdown
Owner

I think using .babelrc is the most standard way to go. Also think the flag should be -c --config as that seems more common.

@leiming

leiming commented Apr 15, 2016

Copy link
Copy Markdown
Author

All right.

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

Successfully merging this pull request may close these issues.

2 participants