gulp-map-transform
Easily transform virtual paths inside any file to real paths
Install
Install via npm:
npm install --save-dev gulp-map-transform
Usage
Transforming scss paths to compiled css paths
Given this section of a html file:
... ...
And this configuration inside your gulpfile
const src dest = ;const sass = ;const mapTransform = ; const OUT_PATH = '/dist/folder';
This will generate the following html file after compiling the css file:
... ...
Options
Name | Type | Required | Description |
---|---|---|---|
search | RegExp |
yes | This expression is used to identify in which location you want to execute a transformation of the content |
replace | RegExp |
yes | This is used to replace the path of the file inside a result of the search matches |
rewrite | Function | yes | Use this to tell what and how to replace the path inside the string found by the replace expression |
transform | Function | yes | In this callback you get a separate stream to handle all your files already present with the real path |
rootPath | string | no | The root path to which the transfomed file paths will be appended (with path.relative() ) |
License
See the LICENSE file for license rights and limitations (MIT).