Skip to content

Commit

Permalink
Pull request electron-userland#81
Browse files Browse the repository at this point in the history
  • Loading branch information
eliot-akira committed Mar 28, 2018
1 parent 9116780 commit e40ff49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/css/sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ export default class SassCompiler extends CompilerBase {
return mimeTypes;
}

static isSassPartial(fileName) {
const basename = path.basename(fileName);
const ext = path.extname(fileName);
return ext==='.scss' && basename[0]==='_';
}

async shouldCompileFile(fileName, compilerContext) { // eslint-disable-line no-unused-vars
return true;
return !SassCompiler.isSassPartial(fileName);
}

async determineDependentFiles(sourceCode, filePath, compilerContext) {
Expand Down Expand Up @@ -87,7 +93,7 @@ export default class SassCompiler extends CompilerBase {
}

shouldCompileFileSync(fileName, compilerContext) { // eslint-disable-line no-unused-vars
return true;
return !SassCompiler.isSassPartial(fileName);
}

determineDependentFilesSync(sourceCode, filePath, compilerContext) { // eslint-disable-line no-unused-vars
Expand Down

0 comments on commit e40ff49

Please sign in to comment.