[First Step] implement transform function for .babelrc.js#43
[First Step] implement transform function for .babelrc.js#43hiroppy wants to merge 3 commits intobabel:masterfrom
Conversation
- rename paths to babelRC - create `writeBabelRCJS` for overwriting `.babelrc.js`
8b46edf to
c1d0001
Compare
c1d0001 to
2896706
Compare
|
|
||
| async function writeBabelRCJS(configPath) { | ||
| try { | ||
| const rawFile = (await pify(fs.readFile)(configPath)).toString('utf8'); |
There was a problem hiding this comment.
Is there any advantage to doing fs.readFile over fs.readFileSync ?
There was a problem hiding this comment.
The only advantage i can see is that it lets the event loop continue during the i/o rather than blocking it.
| @@ -0,0 +1,31 @@ | |||
| const jscodeshift = require('jscodeshift'); | |||
There was a problem hiding this comment.
this is fine but I had wanted to use https://github.com/square/babel-codemod for this.
|
Nice start! However I don't think replacing .babelrc.js is much of a priority for us (at least for Babel v7, it will be plenty useful in the future). You can only use that file in v7 alpha so this would only be useful for people changing from alpha to beta, and most people will be upgrading their |
|
@hzoo That’s true. I agree with you:) Ok, we'll merge only this PR and let's do another task:smile: |
|
probably related #49 |
This is the first step for replacing
.babelrc.js:)Currently, it is possible to replace arrays without nests.
Next, we have to deal with the following