Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #3481
Closed
Open
Issue created Nov 22, 2017 by Administrator@rootContributor

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

Assignee
Assign to
Time tracking