I have a child repo called fetch, which wrap the origin fetch. This project is designed to be used both in node (with node-fetch) and browser.
but it is running into error, even we've precompiled it.
the .babelrc for repo fetch
{
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
],
"stage-0"
],
"plugins": [
[
"transform-builtin-extend",
{
"globals": ["Error", "Array"]
}
]
]
}
Here we use targets node, since it is required for async/await transforming.
related babel dependencies.
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.3",
"babel-jest": "^23.2.0",
"babel-plugin-transform-builtin-extend": "^1.1.2",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1"
compile to
https://gist.github.com/zzswang/9763fe903b364d2e4f11b1a4618aa669
when used it in create-react-app
It is running into the minify error.
There must be something wrong with my .babelrc.
If we change targets from:
[
"env",
{
"targets": {
"node": "current"
}
}
]
to
[
"env",
{
"modules": false
}
]
minify will be ok, but start dev will failed due to:
ReferenceError: regeneratorRuntime is not defined
Could anyone help?
Thanks.
I have a child repo called
fetch, which wrap the origin fetch. This project is designed to be used both in node (withnode-fetch) and browser.but it is running into error, even we've precompiled it.
the .babelrc for repo
fetch{ "presets": [ [ "env", { "targets": { "node": "current" } } ], "stage-0" ], "plugins": [ [ "transform-builtin-extend", { "globals": ["Error", "Array"] } ] ] }Here we use targets node, since it is required for
async/awaittransforming.related babel dependencies.
compile to
https://gist.github.com/zzswang/9763fe903b364d2e4f11b1a4618aa669
when used it in create-react-app
It is running into the minify error.
There must be something wrong with my
.babelrc.If we change targets from:
to
minify will be ok, but start dev will failed due to:
Could anyone help?
Thanks.