Create a modified babel preset based on an an existing preset.
Works best with
npm i -S modify-babel-preset
A single function that takes an existing preset name and a mapping of plugin modifications to apply to that preset. Make sure you have the preset and any added plugins installed as dependencies.
Modification keys are babel plugin names (you can exclude the
To add a plugin, pass
true, or a configuration object:
// just add a plugin without config:'plugin-name': true// add a plugin and set its config'other-plugin': loose:true
Note: adding a plugin that is already provided by the preset just overwrites its configuration.
To remove a plugin, pass
Here's a simple preset. Just this
index.js and a package.json pointing to it with the preset and plugin installed as dependencies.
var modifyBabelPreset = ;// just export the cloned, modified preset config:moduleexports =;