gulp-htmlbuild
gulp-htmlbuild copied to clipboard
block of dynamic Less gets injected as link stylesheet rather than stylesheet/less
I have
<link rel="stylesheet/less" type="text/less" href="styles/nonCacheable/sprinkler.less" />
it should create
but it creates which breaks the dynamic less.js
Can you help?
Are you using htmlbuild.preprocess.css? That probably won't work for you. You're going to need to write your own implementation for less.
Read this code to understand how these functions work so you can write your own less-specific version of it: https://github.com/Janpot/gulp-htmlbuild/blob/master/lib/preprocess/css.js#L19
how do i incorporate my new blabla.js preporocessor into your code base?
The same way as in the readme example:
const blablaPreprocessor = require('./blabla.js');
gulp.task('build', function () {
gulp.src(['./index.html'])
.pipe(htmlbuild({
// build blabla with blablaPreprocessor
blabla: blablaPreprocessor(function (block) {
// read paths from the [block] stream and build them
// ...
// then write the build result path to it
block.write('buildresult.blabla');
block.end();
})
}))
.pipe(gulp.dest('./build'));
});
awesome. thanks it worked :)