Skip to content

Commit

Permalink
Build: Add support for all scss files in build-style directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Aug 9, 2018
1 parent b36cf04 commit 8362a83
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bin/packages/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ function buildPackageScss( packagePath ) {
return;
}

const outputFile = path.resolve( packagePath, BUILD_DIR.style, 'style.css' );
const outputFileRTL = path.resolve( packagePath, BUILD_DIR.style, 'style-rtl.css' );
buildScssFile( styleFile );
}

function buildScssFile( styleFile ) {
const outputFile = getBuildPath( styleFile, BUILD_DIR.style );
const outputFileRTL = getBuildPath( styleFile.replace( '.scss', '-rtl.scss' ), BUILD_DIR.style );
mkdirp.sync( path.dirname( outputFile ) );
const builtSass = sass.renderSync( {
file: styleFile,
Expand Down Expand Up @@ -203,8 +207,10 @@ function buildPackage( packagePath ) {
// Build js files individually.
jsFiles.forEach( ( file ) => buildJsFile( file, true ) );

// Build entire package scss.
buildPackageScss( packagePath );
const scssFiles = glob.sync( `${ srcDir }/*.scss` );

// Build scss files individually.
scssFiles.forEach( buildScssFile );

process.stdout.write( `${ DONE }\n` );
}
Expand Down

0 comments on commit 8362a83

Please sign in to comment.