mirror of
https://github.com/vacp2p/waku-site.git
synced 2026-01-08 21:18:15 -05:00
Gulpfile refactor
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="dist/css/styles.css" rel="stylesheet" />
|
||||
<link href="./css/styles.css" rel="stylesheet" />
|
||||
<title>Waku</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
@@ -216,7 +216,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="dist/js/main.js"></script>
|
||||
<script src="./js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="dist/css/styles.css" rel="stylesheet" />
|
||||
<link href="./css/styles.css" rel="stylesheet" />
|
||||
<title>Waku</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
@@ -211,7 +211,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="dist/js/main.js"></script>
|
||||
<script src="./js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
20
gulpfile.js
20
gulpfile.js
@@ -13,8 +13,8 @@ function cssTask(cb) {
|
||||
cb();
|
||||
}
|
||||
|
||||
function scripts(cb) {
|
||||
return src(['src/*.js',])
|
||||
function scriptsTask(cb) {
|
||||
return src('./src/*.js')
|
||||
.pipe(uglify())
|
||||
.pipe(dest('./dist/js'))
|
||||
.pipe(browserSync.stream());
|
||||
@@ -23,9 +23,15 @@ function scripts(cb) {
|
||||
|
||||
// Task for minifying images
|
||||
function imageminTask(cb) {
|
||||
return src("./dist/images/*")
|
||||
return src('./img/**/*')
|
||||
.pipe(imagemin())
|
||||
.pipe(dest("./dist/images"));
|
||||
.pipe(dest("./dist/img"));
|
||||
cb();
|
||||
}
|
||||
|
||||
function htmlBuild(cb) {
|
||||
return src("./*.html") // read .css files from ./src/ folder
|
||||
.pipe(dest("./dist")) // paste them in ./dist/css folder
|
||||
cb();
|
||||
}
|
||||
|
||||
@@ -47,12 +53,12 @@ function browsersyncReload(cb) {
|
||||
function watchTask() {
|
||||
watch("./**/*.html", browsersyncReload);
|
||||
watch(["./src/*.css"], series(cssTask, browsersyncReload));
|
||||
watch(["./src/*.js"], series(scripts, browsersyncReload));
|
||||
watch(["./src/*.js"], series(scriptsTask, browsersyncReload));
|
||||
}
|
||||
|
||||
// Default Gulp Task
|
||||
exports.default = series(cssTask, browsersyncServe, watchTask);
|
||||
exports.build = series(cssTask, scriptsTask, imageminTask, htmlBuild);
|
||||
exports.default = series(cssTask, scriptsTask, imageminTask, htmlBuild, browsersyncServe, watchTask);
|
||||
exports.css = cssTask;
|
||||
exports.images = imageminTask;
|
||||
exports.scripts = scripts;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="dist/css/styles.css" rel="stylesheet" />
|
||||
<link href="./css/styles.css" rel="stylesheet" />
|
||||
<title>Waku</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
@@ -393,7 +393,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="dist/js/main.js"></script>
|
||||
<script src="./js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link href="dist/css/styles.css" rel="stylesheet" />
|
||||
<link href="./css/styles.css" rel="stylesheet" />
|
||||
<title>Waku</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
@@ -301,7 +301,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="dist/js/main.js"></script>
|
||||
<script src="./js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"main": "index.html",
|
||||
"scripts": {
|
||||
"dev": "gulp",
|
||||
"build": "NODE_ENV=production gulp css",
|
||||
"build": "NODE_ENV=production gulp build",
|
||||
"build-images": "gulp images"
|
||||
},
|
||||
"keywords": [
|
||||
|
||||
@@ -34,12 +34,12 @@ module.exports = {
|
||||
},
|
||||
extend: {
|
||||
backgroundImage: theme => ({
|
||||
'link-arrow-black': "url('/img/arrow/arrow-black.svg')",
|
||||
'link-arrow-blue': "url('/img/arrow/arrow-blue.svg')",
|
||||
'link-arrow-white': "url('/img/arrow/arrow-white.svg')",
|
||||
'branch': "url('/img/branch.svg')",
|
||||
'eye-open-black': "url('/img/icon/eye-open-black.svg')",
|
||||
'eye-close-white': "url('/img/icon/eye-close-white.svg')",
|
||||
'link-arrow-black': "url('./img/arrow/arrow-black.svg')",
|
||||
'link-arrow-blue': "url('./img/arrow/arrow-blue.svg')",
|
||||
'link-arrow-white': "url('./img/arrow/arrow-white.svg')",
|
||||
'branch': "url('./img/branch.svg')",
|
||||
'eye-open-black': "url('./img/icon/eye-open-black.svg')",
|
||||
'eye-close-white': "url('./img/icon/eye-close-white.svg')",
|
||||
}),
|
||||
fontSize: theme => ({
|
||||
'10': '.625rem'
|
||||
|
||||
Reference in New Issue
Block a user