mirror of
https://github.com/penpot/penpot.git
synced 2025-01-23 06:58:58 -05: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 watch = require("gulp-watch");
|
||||||
var cssmin = require("gulp-cssmin");
|
var cssmin = require("gulp-cssmin");
|
||||||
var rimraf = require("rimraf");
|
var rimraf = require("rimraf");
|
||||||
|
var mustache = require("gulp-mustache");
|
||||||
|
var rename = require("gulp-rename");
|
||||||
|
|
||||||
var paths = {};
|
var paths = {};
|
||||||
paths.app = "./resources/";
|
paths.app = "./resources/";
|
||||||
|
@ -34,6 +36,19 @@ gulp.task("cssmin", function() {
|
||||||
.pipe(gulp.dest(paths.output + "css/"));
|
.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) {
|
gulp.task("styles-dev", function(next) {
|
||||||
runseq("scss", "autoprefixer", next);
|
runseq("scss", "autoprefixer", next);
|
||||||
});
|
});
|
||||||
|
@ -61,10 +76,10 @@ gulp.task("copy", function() {
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
gulp.task("dist", function(next) {
|
gulp.task("dist", function(next) {
|
||||||
runseq("styles-dist", "cssmin", "clean-dist", "copy", next);
|
runseq("styles-dist", "cssmin", "template", "clean-dist", "copy", next);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Watch
|
// Watch
|
||||||
gulp.task("default", ["styles-dev"], function () {
|
gulp.task("default", ["styles-dev", "template"], function () {
|
||||||
gulp.watch(paths.scss, ["styles-dev"]);
|
gulp.watch(paths.scss, ["styles-dev"]);
|
||||||
});
|
});
|
||||||
|
|
21
npm-shrinkwrap.json
generated
21
npm-shrinkwrap.json
generated
|
@ -752,6 +752,11 @@
|
||||||
"from": "graceful-fs@>=2.0.0 <2.1.0",
|
"from": "graceful-fs@>=2.0.0 <2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
|
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-2.0.3.tgz"
|
||||||
},
|
},
|
||||||
|
"gulp-rename": {
|
||||||
|
"version": "1.1.0",
|
||||||
|
"from": "gulp-rename@>=1.1.0 <1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.1.0.tgz"
|
||||||
|
},
|
||||||
"gulp-util": {
|
"gulp-util": {
|
||||||
"version": "2.2.20",
|
"version": "2.2.20",
|
||||||
"from": "gulp-util@>=2.2.0 <2.3.0",
|
"from": "gulp-util@>=2.2.0 <2.3.0",
|
||||||
|
@ -824,15 +829,20 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gulp-mustache": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"from": "gulp-mustache@latest",
|
||||||
|
"resolved": "https://registry.npmjs.org/gulp-mustache/-/gulp-mustache-2.2.0.tgz"
|
||||||
|
},
|
||||||
"gulp-plumber": {
|
"gulp-plumber": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"from": "gulp-plumber@1.1.0",
|
"from": "gulp-plumber@1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/gulp-plumber/-/gulp-plumber-1.1.0.tgz"
|
"resolved": "https://registry.npmjs.org/gulp-plumber/-/gulp-plumber-1.1.0.tgz"
|
||||||
},
|
},
|
||||||
"gulp-rename": {
|
"gulp-rename": {
|
||||||
"version": "1.1.0",
|
"version": "1.2.2",
|
||||||
"from": "gulp-rename@>=1.1.0 <1.2.0",
|
"from": "gulp-rename@latest",
|
||||||
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.1.0.tgz"
|
"resolved": "https://registry.npmjs.org/gulp-rename/-/gulp-rename-1.2.2.tgz"
|
||||||
},
|
},
|
||||||
"gulp-sass": {
|
"gulp-sass": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
|
@ -1373,6 +1383,11 @@
|
||||||
"from": "multipipe@>=0.1.2 <0.2.0",
|
"from": "multipipe@>=0.1.2 <0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz"
|
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz"
|
||||||
},
|
},
|
||||||
|
"mustache": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"from": "mustache@>=2.2.1 <3.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mustache/-/mustache-2.2.1.tgz"
|
||||||
|
},
|
||||||
"nan": {
|
"nan": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
"from": "nan@>=2.0.8 <3.0.0",
|
"from": "nan@>=2.0.8 <3.0.0",
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
"gulp-autoprefixer": "3.1.0",
|
"gulp-autoprefixer": "3.1.0",
|
||||||
"gulp-clean": "0.3.1",
|
"gulp-clean": "0.3.1",
|
||||||
"gulp-cssmin": "0.1.7",
|
"gulp-cssmin": "0.1.7",
|
||||||
|
"gulp-mustache": "2.2.0",
|
||||||
"gulp-plumber": "1.1.0",
|
"gulp-plumber": "1.1.0",
|
||||||
|
"gulp-rename": "1.2.2",
|
||||||
"gulp-sass": "2.2.0",
|
"gulp-sass": "2.2.0",
|
||||||
"gulp-watch": "4.3.5",
|
"gulp-watch": "4.3.5",
|
||||||
"rimraf": "2.5.2",
|
"rimraf": "2.5.2",
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||||
<title>uxbox.io - ???</title>
|
<title>uxbox.io - ???</title>
|
||||||
<link href="/css/main.css" rel="stylesheet" type="text/css" />
|
<link href="{{& cssfile}}" rel="stylesheet" type="text/css" />
|
||||||
<link rel="icon" href="/images/favicon.png" />
|
<link rel="icon" href="/images/favicon.png" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section id="app" tabindex="1"></section>
|
<section id="app" tabindex="1"></section>
|
||||||
<section id="lightbox" tabindex="2"></section>
|
<section id="lightbox" tabindex="2"></section>
|
||||||
<script src="/js/main.js"></script>
|
<script src="{{& jsfile}}"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Add table
Reference in a new issue