A Gulp plugin for bundling js and css resources as an external reference.
The plugin is minimalistic and simple. It rebases a chosen css files stream urls to a new base url.
+ src- file.css+ fldr- image.jpg- file2.css
Where 'file.css' contents are:
and 'file2.css' contents are:
And the task:
var rebaseCssUrls =concat = ;gulp;
Results in a directory like so:
+ dst- bundle.css+ fldr- image.jpg
And a bundle.css contents like so:
The new base url, comparing to initial file's src.
Running the gulp file would concat
tests/input files into
tests/actual and compare the results to a static
tests/expected directory, and make sure we got what we've expected.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Gulp.