1.6.0 • Published 2 years ago
distr v1.6.0
distr
Smartly change src path to dist path, for use in small build systems.
Installation
$ npm i distr;
Configuration
{
source: 'src', // directory fragment to target can be RegExp: /src|source/
destination: 'dist', // new name to use
limit:1 // number of replacements to make
}
Example
const distr = require('distr');
distr('./src/www/index.html');
//-> ./dist/www/index.html
distr('./sources/widgets/upload-component/src/index.js', {source:/sources|src/, limit:2});
//-> ./dist/widgets/upload-component/dist/index.js