mirror of
https://github.com/penpot/penpot.git
synced 2025-05-30 11:46:12 +02:00
Add template compilation to the gulp pipeline.
Just for avoid cache problems in production.
This commit is contained in:
parent
a9186bfbaa
commit
f00c322689
4 changed files with 39 additions and 7 deletions
19
gulpfile.js
19
gulpfile.js
|
@ -7,6 +7,8 @@ var autoprefixer = require('gulp-autoprefixer');
|
|||
var watch = require("gulp-watch");
|
||||
var cssmin = require("gulp-cssmin");
|
||||
var rimraf = require("rimraf");
|
||||
var mustache = require("gulp-mustache");
|
||||
var rename = require("gulp-rename");
|
||||
|
||||
var paths = {};
|
||||
paths.app = "./resources/";
|
||||
|
@ -34,6 +36,19 @@ gulp.task("cssmin", function() {
|
|||
.pipe(gulp.dest(paths.output + "css/"));
|
||||
});
|
||||
|
||||
gulp.task("template", function() {
|
||||
var ts = Math.floor(new Date());
|
||||
var tmpl = mustache({
|
||||
jsfile: "/js/main.js?v=" + ts,
|
||||
cssfile: "/css/main.css?v=" + ts
|
||||
})
|
||||
|
||||
return gulp.src(paths.app + "index.mustache")
|
||||
.pipe(tmpl)
|
||||
.pipe(rename("index.html"))
|
||||
.pipe(gulp.dest(paths.output));
|
||||
});
|
||||
|
||||
gulp.task("styles-dev", function(next) {
|
||||
runseq("scss", "autoprefixer", next);
|
||||
});
|
||||
|
@ -61,10 +76,10 @@ gulp.task("copy", function() {
|
|||
|
||||
// Default
|
||||
gulp.task("dist", function(next) {
|
||||
runseq("styles-dist", "cssmin", "clean-dist", "copy", next);
|
||||
runseq("styles-dist", "cssmin", "template", "clean-dist", "copy", next);
|
||||
});
|
||||
|
||||
// Watch
|
||||
gulp.task("default", ["styles-dev"], function () {
|
||||
gulp.task("default", ["styles-dev", "template"], function () {
|
||||
gulp.watch(paths.scss, ["styles-dev"]);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue