This plugin integrate babel configuration to project. With redux and integration him to react infrastructure it will give following:
- Add babel - transpiling library
Method to add specific babel plugin to babel configuration without specific environment
const babelPlugin = path.resolve(__dirname, '../lib/babel-plugin.js')
class Plugin extends PluginInstance {
start() {
this.babel.addPlugin(babelPlugin)
}
}
const whenBabelPlugin = {
env: {
production: {
plugins: [path.resolve(__dirname, '../lib/babel-plugin.js')]
}
}
}
class Plugin extends PluginInstance {
start() {
this.babel.addConfig(whenBabelPlugin)
}
}
To access dependencies you should import them from this plugin