Compare commits

..

No commits in common. "2f13a24fb676a30ed8872d0cbb20c8b91d9a0275" and "a5a9a690a6605e7b56a65b2407444b2db4ba90a2" have entirely different histories.

8 changed files with 5 additions and 49 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
src/includes/svg/

View File

@ -8,7 +8,6 @@ Default build directory is `./build`. To change edit `gulpfile.js`.
* SASS compilation, css minification.
* HTML file includes.
* Mustache templating
* SVG optimisation.
* BrowserSync.
## TODO

View File

@ -6,7 +6,6 @@ const babel = require('gulp-babel');
const terser = require('gulp-terser');
const mustache = require('gulp-mustache');
const fileInclude = require('gulp-file-include');
const svgmin = require('gulp-svgmin');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const postcssPresetEnv = require('postcss-preset-env');
@ -24,14 +23,12 @@ const srcDir = './src/';
const buildDir = './build/';
const jsSrc = path.join(srcDir, 'js/**/*.js');
const jsDest = path.join(buildDir, 'js/');
const htmlTemplateSrc = path.join(srcDir, 'html/templates/**/*.mustache');
const includeBaseDir = path.join(srcDir, 'includes/');
const includeSrc = path.join(includeBaseDir, '**/*');
const scssSrc = path.join(srcDir, 'scss/**/*.scss');
const cssDest = path.join(buildDir, 'css/');
const htmlSrc = path.join(srcDir, 'html/**/*.html');
const mustacheSrc = path.join(srcDir, 'html/templates/**/*.mustache');
const includeBaseDir = path.join(srcDir, 'includes/');
const includeSrc = path.join(includeBaseDir, '**/*');
const svgSrc = path.join(srcDir, 'svg/**/*.svg');
const svgDest = path.join(includeBaseDir, 'svg/');
const htmlDest = buildDir;
const assetSrc = path.join(srcDir, 'assets/**/*');
const assetDest = path.join(buildDir, 'assets/');
@ -67,12 +64,6 @@ function scssCompile() {
.pipe(server.stream());
}
function svgOptimise() {
return src(svgSrc)
.pipe(svgmin())
.pipe(dest(svgDest));
}
function htmlCompile() {
return src(htmlSrc)
.pipe(
@ -107,20 +98,14 @@ function reload(done) {
const jsWatch = () =>
watch(jsSrc, { ignoreInitial: false }, series(jsClean, jsTranspile, reload));
const cssWatch = () =>
watch(scssSrc, { ignoreInitial: false }, series(cssClean, scssCompile));
const svgWatch = () =>
watch(svgSrc, { ignoreInitial: false }, series(svgOptimise));
const htmlWatch = () =>
watch(
[htmlSrc, includeSrc, mustacheSrc],
{ ignoreInitial: false },
series(htmlClean, htmlCompile, reload)
);
const assetWatch = () =>
watch(
assetSrc,
@ -128,12 +113,4 @@ const assetWatch = () =>
series(assetClean, assetCompile, reload)
);
exports.default = parallel(
jsWatch,
cssWatch,
svgWatch,
htmlWatch,
assetWatch,
serve
);
exports.default = parallel(jsWatch, cssWatch, htmlWatch, assetWatch, serve);

View File

@ -32,7 +32,6 @@
"@babel/polyfill": "^7.6.0",
"gulp-file-include": "^2.2.2",
"gulp-mustache": "^5.0.0",
"gulp-svgmin": "^2.2.0",
"modern-css-reset": "^1.1.0"
}
}

View File

@ -1 +0,0 @@
Files placed here will be copied to `build/assets/` unaltered.

View File

@ -1,6 +0,0 @@
DO NOT place SVG files directly in this directory.
Place SVG files to be optimised in `src/svg/`.
If a SVG file is not to be optimised place it in `src/includes/` (or place in
`src/html/templates` to include with Mustache).

View File

@ -1,3 +0,0 @@
SVG files placed in here will be watched and optimised to be copied to `src/includes/svg/`.
Use `@@include('svg/file.svg')` to include them from `src/includes/svg`.

View File

@ -3730,14 +3730,6 @@ gulp-sourcemaps@^2.6.5:
strip-bom-string "1.X"
through2 "2.X"
gulp-svgmin@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/gulp-svgmin/-/gulp-svgmin-2.2.0.tgz#eabc2b97aa4aef90c21cef65ae5499b075007323"
integrity sha512-MjfZ7DNlomplrhACwmdowPnAV3firF+3432chp1XQyy6OxbZmM7AyMwsITfglS6bGaE3msKiNeqIb0Sn3LHlyg==
dependencies:
plugin-error "^1.0.1"
svgo "^1.2.1"
gulp-terser@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/gulp-terser/-/gulp-terser-1.2.0.tgz#41df2a1d0257d011ba8b05efb2568432ecd0495b"
@ -7109,7 +7101,7 @@ sver-compat@^1.5.0:
es6-iterator "^2.0.1"
es6-symbol "^3.1.1"
svgo@^1.0.0, svgo@^1.2.1:
svgo@^1.0.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.3.2.tgz#b6dc511c063346c9e415b81e43401145b96d4167"
integrity sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==