diff --git a/gulpfile.js b/gulpfile.js index 5294162..21d9a8b 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,4 +1,5 @@ const { src, dest, series, parallel, watch } = require('gulp'), + del = require('del'), gulpSass = require('gulp-sass'), asciidoctor = require('@asciidoctor/gulp-asciidoctor'), gulpConnect = require('gulp-connect'); @@ -14,6 +15,11 @@ const paths = { * Building the theme */ +// Cleans the build folder for the dev lifecycle +function clean(cb) { + del([paths.dist + '**'], cb()); +} + // Compile SASS files to build/dist/css/ function sass() { return src(paths.sass) @@ -71,6 +77,11 @@ function watchFiles(cb) { cb(); } +// cleans the build folder for the dev lifecycle +function cleanDev(cb) { + del([paths.web + '**'], cb()); +} + // Serve sample document and reload for changes function connect(cb) { gulpConnect.server({ @@ -80,7 +91,7 @@ function connect(cb) { cb(); } -const build = series(sass, copyResource); +const build = series(clean, sass, copyResource); const update = series(build, copyDist, render); exports.default = build; -exports.dev = series(update, parallel(connect, watchFiles)); \ No newline at end of file +exports.dev = series(cleanDev, update, parallel(connect, watchFiles)); \ No newline at end of file diff --git a/package.json b/package.json index 82f2ca9..5284bbd 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "version": "0.1.1", "repository": "https://github.com/spring-io/spring-doc-resources", "license": "Apache-2.0", - "dependencies": {}, "devDependencies": { "@asciidoctor/gulp-asciidoctor": "^2.2.5", + "del": "^6.0.0", "gulp": "^4.0.2", "gulp-connect": "^5.7.0", "gulp-sass": "^4.1.0", diff --git a/src/main/resources/js/highlight/styles/atom-one-light.css b/src/main/resources/js/highlight/styles/atom-one-light.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/atom-one-light.css rename to src/main/resources/js/highlight/styles/atom-one-light.min.css diff --git a/src/main/resources/js/highlight/styles/github-gist.css b/src/main/resources/js/highlight/styles/github-gist.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/github-gist.css rename to src/main/resources/js/highlight/styles/github-gist.min.css diff --git a/src/main/resources/js/highlight/styles/github.css b/src/main/resources/js/highlight/styles/github.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/github.css rename to src/main/resources/js/highlight/styles/github.min.css diff --git a/src/main/resources/js/highlight/styles/googlecode.css b/src/main/resources/js/highlight/styles/googlecode.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/googlecode.css rename to src/main/resources/js/highlight/styles/googlecode.min.css diff --git a/src/main/resources/js/highlight/styles/solarized-light.css b/src/main/resources/js/highlight/styles/solarized-light.min.css similarity index 100% rename from src/main/resources/js/highlight/styles/solarized-light.css rename to src/main/resources/js/highlight/styles/solarized-light.min.css