rule-inheritance-webpack-plugin
v0.3.0
Published
Inherit webpack rules from sub-packages.
Maintainers
Readme
rule-inheritance-webpack-plugin
Inherit webpack rules from sub-packages. This plugin will copy all configuration from module.rules with additional include option to make rules are only applied in sub-packages. It will be useful when working with a monorepo with multiple webpack configurations.
Usage
const RuleInheritancePlugin = require('rule-inheritance-webpack-plugin');
module.exports = {
// ...
plugins: [
new RuleInheritancePlugin({
// List of paths to sub-packages.
packages: [
path.resolve(__dirname, '../packages/package-a'),
path.resolve(__dirname, '../packages/package-b')
],
// [Optional] True to inherit rules recursively if sub-package also have
// a RuleInheritancePlugin. Default value is `true`.
recursive: true
})
],
};