webpack-resolve-path-rewrite-plugin
A plugin for enhanced-resolve
(Webpack v2) that replaces specified string inside the path.
Installation
npm install --save-dev webpack-resolve-path-rewrite-plugin
Usage
var path = ;var PathRewrite = ; moduleexports = // ... resolve: plugins: pathMap: '/module/': '/../../CommonEngine/src/module/' // ...;
Example:
webpack.config.js
pathMap: '/module/': '/../../CommonEngine/src/module/'
actions/sendForm.js
Why
Why rewrite paths?
When:
- Multiple entrypoints require a common module inside their directory (i.e. submodule)
- You want to use CommonsChunkPlugin
Change log
1.0.1
Solved bugs.
1.0.0
Initial release.