I'm using babel-preset-react-app to transpile a npm package with just babel that I'm consuming in a CRA app.
It worked well with babel-preset-react-app@3.1.1 and babel@6, but when I updated to babel-preset-react-app@5.0.3 and babel@7 the output build contained relative imports for babel stuff instead on inlining the functions
Before upgrade:
function_objectWithoutProperties(obj,keys){vartarget={};for(variinobj){if(keys.indexOf(i)>=0)continue;if(!Object.prototype.hasOwnProperty.call(obj,i))continue;target[i]=obj[i];}returntarget;}function_classCallCheck(instance,Constructor){if(!(instanceinstanceofConstructor)){thrownewTypeError("Cannot call a class as a function");}}importReact,{Component}from'react';After upgrade:
import_objectWithoutPropertiesfrom"/Users/bogdansoare/Sites/platform_shared/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties";import_classCallCheckfrom"/Users/bogdansoare/Sites/platform_shared/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck";import_createClassfrom"/Users/bogdansoare/Sites/platform_shared/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/createClass";importReact,{Component}from'react';The build command that I'm using is NODE_ENV=production babel src --out-dir build --copy-files
Am I doing something wrong with the new version of babel-preset-react-app ? Or it's a config issue from babel?
I'm using
babel-preset-react-appto transpile a npm package with just babel that I'm consuming in a CRA app.It worked well with
babel-preset-react-app@3.1.1andbabel@6, but when I updated tobabel-preset-react-app@5.0.3andbabel@7the output build contained relative imports for babel stuff instead on inlining the functionsBefore upgrade:
After upgrade:
The build command that I'm using is
NODE_ENV=production babel src --out-dir build --copy-filesAm I doing something wrong with the new version of babel-preset-react-app ? Or it's a config issue from babel?