Skip to content

Commit

Permalink
Copy .scss files from /src to /build to allow external apps to reuse …
Browse files Browse the repository at this point in the history
…Voyager components
  • Loading branch information
light-and-salt authored and kanitw committed Apr 22, 2018
1 parent 5471b3f commit a5f3944
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ measureFileSizesBeforeBuild(paths.appBuild).then(previousFileSizes => {

// Copy data folder
copyDataFolder();

// Copy scss files from /src to /build
copyScss();
});

// Print out errors
Expand Down Expand Up @@ -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');
}
}
});
}

0 comments on commit a5f3944

Please sign in to comment.