How to use gulp-file-include - 4 common examples

To help you get started, we’ve selected a few gulp-file-include examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github questdb / questdb / ui / gulpfile.babel.js View on Github external
function html() {
    return src('app/*.html')
        .pipe(fileinclude({
            prefix: '@@',
            basepath: '@file'
        }))
        .pipe($.useref({searchPath: ['.tmp', 'app', '.']}))
        .pipe($.if('/\.js$/', $.uglify({compress: {drop_console: true}})))
        .pipe($.if('/\.css$/b', $.cssnano({safe: true, autoprefixer: false, discardComments: {removeAll: true}})))
        .pipe($.if('/\.html$/', $.htmlmin({
            collapseWhitespace: true,
            minifyCSS: true,
            minifyJS: {compress: {drop_console: true}},
            processConditionalComments: true,
            removeComments: true,
            removeEmptyAttributes: true,
            removeScriptTypeAttributes: true,
            removeStyleLinkTypeAttributes: true
        })))
github FredHutch / Oncoscape / documentation / gulpfile.babel.js View on Github external
gulp.task('html', ['styles'], () => {
    //const assets = $.useref.assets({ searchPath: ['.tmp', 'app', '.'] });
    return gulp.src('app/*.html')
        .pipe($.if('*.html', fileinclude({ prefix: '@@', basepath: '@root' })))
        //.pipe($.if('*.html', $.minifyHtml({ conditionals: true, loose: true })))
        //.pipe(assets)
        //.pipe($.if('*.js', $.uglify()))
        //.pipe($.if('*.css', $.minifyCss({ compatibility: '*' })))
        //.pipe(assets.restore())
        .pipe($.useref())
        .pipe(gulp.dest('dist'));


});
github FredHutch / Oncoscape / documentation / gulpfile.babel.js View on Github external
gulp.task('files', () => {
    return gulp.src('app/**/*.html')
        .pipe(fileinclude({ prefix: '@@', basepath: '@root' }))
        .pipe(gulp.dest('.tmp/'));
});
github krmao / template / apps / app-template / web_gulp / build-script / Build.js View on Github external
.pipe(tap(function (file) {
                    let htmlName = path.basename(file.path).replace('.html', '');
                    gulp.src(_this.module.srcPathTemplateFile)
                        .pipe(strip.text())
                        .pipe(fileInclude({prefix: '@@', basepath: '@file', context: {moduleName: _this.module.moduleName, htmlName: htmlName}}))
                        .pipe(replace('../img', '../../static/images/' + _this.module.moduleName)) //fixme important
                        .pipe(rename({basename: htmlName, extname: '.html'}))
                        .pipe(gulp.dest(_this.module.buildOutputPathHtmls));
                }
            ))

gulp-file-include

A gulp plugin for file include

MIT
Latest version published 4 years ago

Package Health Score

48 / 100
Full package analysis

Popular gulp-file-include functions