From e3f58fd706899f009e703320b3b0b9c996ae9985 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@inrae.fr>
Date: Tue, 5 May 2020 18:26:15 +0200
Subject: [PATCH] =?UTF-8?q?"Ancre"=20les=20r=C3=A9pertoires=20d'entr=C3=A9?=
 =?UTF-8?q?e=20et=20de=20sortie=20dans=20le=20dossier=20des=20sources.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Pour qu'on puisse utilise le "build" depuis un autre gulpfile.
---
 gulpfile.esm.js | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/gulpfile.esm.js b/gulpfile.esm.js
index ed51c27..6dc3696 100644
--- a/gulpfile.esm.js
+++ b/gulpfile.esm.js
@@ -10,18 +10,19 @@ import terser from "gulp-terser";
 
 sass.compiler = sass_compiler;
 
+const SRC = __dirname + "/src";
+const DEST = __dirname + "/public";
 const UPSTREAM = "node_modules/reveal.js";
-const DEST = "public";
 
 const src = (globs, opts = {}) =>
-  _src(globs, { cwd: __dirname, base: "src/", ...opts });
-const upstream = (globs, opts = {}) => src(globs, { base: UPSTREAM, ...opts });
-const dest = (target, opts = {}) => _dest(target, { cwd: __dirname, ...opts });
+  _src(globs, { base: SRC, ...opts });
+const upstream = (globs, opts = {}) => _src(globs, { base: UPSTREAM, ...opts });
+const dest = (target, opts = {}) => _dest(target, { base: DEST, ...opts });
 
-export const clean = () => del(`public/**`);
+export const clean = () => del(`${DEST}/**`, { force: true });
 
 export const misc = () =>
-  src([`src/**/*.{eot,otf,ttf,woff,woff2,json,html}`, `src/**/LICENSE`])
+  src([`${SRC}/**/*.{eot,otf,ttf,woff,woff2,json,html}`, `${SRC}/**/LICENSE`])
     .pipe(
       upstream([
         `${UPSTREAM}/**/*.{eot,otf,ttf,woff,woff2,json,html}`,
@@ -33,7 +34,7 @@ export const misc = () =>
     .pipe(dest(DEST));
 
 export const stylesheets = () =>
-  src(`src/**/*.css`)
+  src(`${SRC}/**/*.css`)
     .pipe(
       upstream([
         `${UPSTREAM}/**/*.css`,
@@ -47,7 +48,7 @@ export const stylesheets = () =>
     .pipe(dest(DEST));
 
 export const images = () =>
-  src(`src/**/*.{png,svg,gif,ico,jpg,jpeg}`)
+  src(`${SRC}/**/*.{png,svg,gif,ico,jpg,jpeg}`)
     .pipe(
       upstream([
         `${UPSTREAM}/**/*.{png,svg,gif,ico,jpg,jpeg}`,
@@ -58,7 +59,7 @@ export const images = () =>
     .pipe(dest(DEST));
 
 export const themes = () =>
-  src(`src/css/theme/source/**/*.scss`, { base: "src/css/theme/source" })
+  src(`${SRC}/css/theme/source/**/*.scss`, { base: `${SRC}/css/theme/source` })
     .pipe(
       upstream(`${UPSTREAM}/css/theme/source/**/*.scss`, {
         base: `${UPSTREAM}/css/theme/source`,
@@ -75,7 +76,7 @@ export const themes = () =>
     .pipe(dest(`${DEST}/css/theme`));
 
 export const code = () =>
-  src([`src/**/*.js`])
+  src([`${SRC}/**/*.js`])
     .pipe(
       upstream([
         `${UPSTREAM}/**/*.js`,
-- 
GitLab