diff --git a/webpack.config.js b/webpack.config.js index e524c9a..cb58674 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,5 @@ const path = require("path"); +const childProcess = require('child_process'); const copy = require("copy-webpack-plugin"); const extract = require("mini-css-extract-plugin"); const webpack = require("webpack"); @@ -47,6 +48,18 @@ const babel_loader = { } } +/* check if sassc is available, to avoid unintelligible error messages */ +try { + childProcess.execFileSync('sassc', ['--version'], { stdio: ['pipe', 'inherit', 'inherit'] }); +} catch (e) { + if (e.code === 'ENOENT') { + console.error("ERROR: You need to install the 'sassc' package to build this project."); + process.exit(1); + } else { + throw e; + } +} + module.exports = { mode: production ? 'production' : 'development', resolve: {