Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
)
].filter(t => t)
return gulp.src("./docs/src/scss/extra*.scss")
.pipe(sass({
includePaths: [
"node_modules/modularscale-sass/stylesheets",
"node_modules/material-design-color",
"node_modules/material-shadows",
"node_modules/mermaid/src/themes"]
}).on("error", sass.logError))
.pipe(postcss(plugins))
.pipe(gulpif(config.compress.enabled, cleanCSS()))
.pipe(
vinylPaths(
filepath => {
return concat(path.basename(filepath, ".scss"))
}))
// Revisioning
.pipe(gulpif(config.revision, rev()))
.pipe(gulp.dest(config.folders.theme))
.pipe(gulpif(config.revision, rev.manifest("manifest.json", {base: config.folders.theme, merge: true})))
.pipe(gulpif(config.revision, gulp.dest(config.folders.theme)))
})
const cssFile = 'main.' + commitHash + '.css';
const jsFile = 'app.' + commitHash + '.js';
const coreFile = 'core.' + coreHash + '.js';
return merge(
gulp.src('./public/index.html')
// replace the app.js script reference with one that points to the minified file
// add in a ?v=[git hash] param to override browser caches when a new version is deployed
.pipe(replace('app.js', jsFile))
.pipe(replace('core.js', coreFile))
// now do the same thing (without minification) for the CSS file
.pipe(replace('main.css', cssFile))
.pipe(gulp.dest('./public')),
// now we have to rename the CSS file to match (JS renaming is handled by minification process)
gulp.src('./public/css/main.css')
.pipe(vinylPaths(del))
.pipe(rename(cssFile))
.pipe(gulp.dest('./public/css'))
);
});
const cleanRequire = () => gulp
.src(require, {
allowEmpty: true,
read: false
})
.pipe(vinylPaths(del));
gulp.task(options.taskName, options.taskDeps, () => {
if (!_isArray(options.src)) {
options.src = [options.src];
}
return gulp.src(options.src).pipe(vinylPaths(del));
});
}
gulp.task('publish:release', ['_release'], () => {
return gulp.src('_release')
.pipe($.subtree({
remote: 'origin',
branch: 'release'
}))
.pipe(vinylPaths(del));
});
export const cleanTmp = () => gulp
.src(tmp, {
allowEmpty: true,
read: false
})
.pipe(vinylPaths(del));
gulp.task('publish:release', ['_release'], () => {
return gulp.src('_release')
.pipe($.subtree({
remote: 'origin',
branch: 'release'
}))
.pipe(vinylPaths(del));
});
gulp.task("mkdocs:clean", () => {
return gulp.src(config.folders.mkdocs, {allowEmpty: true})
.pipe(vinylPaths(del))
})