Webpack plugin that lets you to extend another module or workspace
MIT License
Let's you have one parent workspace and multiple child workspaces that override only specific modules (styles, assets, etc.) of the parent. That way having a main web application, you can easily adapt it to different platforms by creating child workspaces with only overrides to specific modules inside. This keeps your project clean and organized.
Note: If you are using bundlewiz
, you do not need to include this plugin yourself as bundlewiz
does it for you. Otherwise follow the steps below.
const PackageExtendResolverPlugin = require('package-extend-resolver-plugin');
// ...
plugins: [
// ...
new PackageExtendResolverPlugin()
]
// ...
If you do not use .jsx
(or other fancy extensions) on the modules that you import without explicitly specifying an extension (e.g import SomeComponent from 'components/SomeComponent
when you really mean SomeComponent.jsx
) and keep all of your modules, and styles and other assets (like images, fonts, etc.) that you import in your modules under the src/
folder, you do not need to provide any options!
node_modules
will be looked up automatically)
.jsx
files, you need to add .jsx
to the array)
const PackageExtendResolverPlugin = require('package-extend-resolver-plugin');
// ...
plugins: [
// ...
new PackageExtendResolverPlugin({
lookIn: [ 'src' ], // default
assumeExtensions: [ '.jsx' ] // now you can include JSX Components without specifying an extension
})
]
// ...