Allow babel experimental plugins to be added to unejected create-react-app
Created by: haraldrudell
There will always be attractive babel experimental plugins Unless @facebook always includes all of them, this will be a sore point
(no, bad idea: I think the easiest way to implement this would be to use the include option of the babel env plugin: https://babeljs.io/docs/plugins/preset-env/#optionsinclude)
One can fish out a field from package.json towards the end of config/paths.js and add that to the end of module.exports:
const craBabelPlugins = Object(Object(Object(ownPackageJson)['create-react-app']).babel).plugins
const babelPlugins = Array.isArray(craBabelPlugins) && craBabelPlugins.every(v => v && typeof v === 'string') && craBabelPlugins || []
…
babelPlugins: babelPlugins,
(no, bad idea: That should then be merged with the output from babel-preset-react which can be object manipulation in webpack.config.dev.js and webpack.config.prod.js)
This way, linting maybe comes free with babel-eslint
Maybe it's easier to put this as a best-effort read of current working directory package.json in the index.js of babel-preset-react-app
I have of course not tested this silly suggestion, half-way I did eject