R
R
Risent Veber2016-12-30 12:23:02
JavaScript
Risent Veber, 2016-12-30 12:23:02

How to remove unused modules in babel presets?

There are several presets in the .babelrc config:

"presets": [
        "es2015",
        "react",
        "stage-0"
    ],

The build is done for node 6.8 which supports ES6 by 97%, so it was decided
to get rid of babel plugins that are not needed - when you try to just split the presets into plugins and write them accordingly in plugins, the build crashes with errors - sometimes when you change the order of plugins - some errors disappear. How to solve this problem and how does the order of presets / plugins affect the final result?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2016-12-30
@bingo347

node 6.0+ supports es2015 100%, you can simply remove the es2015 preset
if you need non-standard es-modules (import/export) - just install them with a plugin, without a preset

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question