diff --git a/scripts/build.js b/scripts/build.js index 25425cc60..4421c28fb 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -44,6 +44,9 @@ measureFileSizesBeforeBuild(paths.appBuild).then(previousFileSizes => { // Copy data folder copyDataFolder(); + + // Copy scss files from /src to /build + copyScss(); }); // Print out errors @@ -102,3 +105,17 @@ function copyDataFolder() { dereference: true, }); } + +// Copy scss files from /src/components/ to /build/components/ for external app to use Voyager components +function copyScss() { + fs.copySync(path.resolve(__dirname, '../src/components'), path.resolve(__dirname, '../build/components'), { + dereference: true, + filter: (path) => { + if (fs.lstatSync(path).isDirectory()) { + return true; + } else { + return path.endsWith('.scss'); + } + } + }); +}