From 135c6986e1bda5d0fe91fcee20a22333d25ad231 Mon Sep 17 00:00:00 2001 From: Cyrille Bollu Date: Wed, 8 Jun 2022 11:38:32 +0200 Subject: [PATCH] Updates frontend-building related Makefile rules to also create the dist/icons.css file. Updates the core/src/icons.js script to allow it to run before 'npm run dev', 'npm run build', or 'npm run watch' is run. Signed-off-by: Cyrille Bollu --- Makefile | 10 +++++++--- core/src/icons.js | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e178d84b8c995..f993e4ee223ca 100644 --- a/Makefile +++ b/Makefile @@ -10,14 +10,18 @@ npm-update: npm update # Building -build-js: +build-js: build-css npm run dev build-js-production: npm run build -watch-js: - npm run watch +watch-js: build-css + npm run watch & + npm run sass:watch + +build-css: + npm run sass:icons # Linting lint-fix: diff --git a/core/src/icons.js b/core/src/icons.js index 6ea8070c9128a..97a9253dc48e7 100644 --- a/core/src/icons.js +++ b/core/src/icons.js @@ -332,4 +332,5 @@ css += generateVariablesAliases(true) css += '}' // WRITE CSS +fs.mkdir('dist', (err) => { if (err) { console.info('Directory dist/ already exists') } }) fs.writeFileSync(path.join(__dirname, '../../dist', 'icons.css'), sass.compileString(css).css)