Skip to content

(feat request) Support options inside babel-preset-react-app  #2985

Closed
@mgcrea

Description

@mgcrea

Is this a bug report?

No

Feature description

I'm currently building a component library with create-react-app, basically, I'm simply building my components with babel for them to be imported by another app, something like:

"build": "rimraf lib/*; NODE_ENV=production babel src/components --out-dir lib/ --ignore '__tests__/**'",

However, for this to work, I need to compile modules to commonjs so they don't have to be re-processed again by the parent app.

Therefore, it would be great to have the ability to pass a module option like what's existing for other presets:

"presets": [["es2015", {"modules": false}], "react"],

Directly to the react-app preset:

"presets": [["react-app", {"modules": "commonjs"}]],

Therefore I could easily keep create-react-app babel's preset but actually build components exactly how I want them.

Changes are trivial, will PR on demand.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions