Skip to content

Warning if transpiling ES modules to commonjs #477

@jakearchibald

Description

@jakearchibald

Some presets, such as 'es2015' will transpile ES6 modules to commonjs. This works fine, but it prevents webpack performing treeshaking, meaning bundles could be unnecessarily larger.

Is there any reason users would want to transpile to commonjs at this point in the pipeline? If not, babel-loader could attempt to change the default here, or at least display a warning if it detects this kind of transpilation occurring.

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