diff --git a/lib/broccoli/angular-broccoli-sass.js b/lib/broccoli/angular-broccoli-sass.js index 9d0f5e35b82e..aca7d93aac20 100644 --- a/lib/broccoli/angular-broccoli-sass.js +++ b/lib/broccoli/angular-broccoli-sass.js @@ -26,10 +26,13 @@ class SASSPlugin extends Plugin { build() { this.listFiles().forEach(fileName => { - // Normalize is necessary for changing `\`s into `/`s on windows. - this.compile(path.normalize(fileName), - path.normalize(this.inputPaths[0]), - path.normalize(this.outputPath)); + // We skip compiling partials (_*.scss files) + if(!/^_+.*.s[ac]ss$/.test(path.basename(fileName))) { + // Normalize is necessary for changing `\`s into `/`s on windows. + this.compile(path.normalize(fileName), + path.normalize(this.inputPaths[0]), + path.normalize(this.outputPath)); + } }); } diff --git a/tests/e2e/e2e_workflow.spec.js b/tests/e2e/e2e_workflow.spec.js index 3c90073b84fe..ea1ea1d2d920 100644 --- a/tests/e2e/e2e_workflow.spec.js +++ b/tests/e2e/e2e_workflow.spec.js @@ -291,12 +291,17 @@ describe('Basic end-to-end Workflow', function () { let componentPath = path.join(process.cwd(), 'src', 'app', 'test-component'); let cssFile = path.join(componentPath, 'test-component.component.css'); let scssFile = path.join(componentPath, 'test-component.component.scss'); + let scssPartialFile = path.join(componentPath, '_test-component.component.partial.scss'); + + let scssPartialExample = '.partial {\n @extend .outer;\n }'; + fs.writeFileSync(scssPartialFile, scssPartialExample, 'utf8'); + expect(existsSync(scssPartialFile)).to.be.equal(true); expect(existsSync(componentPath)).to.be.equal(true); sh.mv(cssFile, scssFile); expect(existsSync(scssFile)).to.be.equal(true); expect(existsSync(cssFile)).to.be.equal(false); - let scssExample = '.outer {\n .inner { background: #fff; }\n }'; + let scssExample = '@import "test-component.component.partial";\n\n.outer {\n .inner { background: #fff; }\n }'; fs.writeFileSync(scssFile, scssExample, 'utf8'); sh.exec(`${ngBin} build`); @@ -304,6 +309,7 @@ describe('Basic end-to-end Workflow', function () { expect(existsSync(destCss)).to.be.equal(true); let contents = fs.readFileSync(destCss, 'utf8'); expect(contents).to.include('.outer .inner'); + expect(contents).to.include('.partial .inner'); sh.rm('-f', destCss); process.chdir('src'); @@ -311,6 +317,7 @@ describe('Basic end-to-end Workflow', function () { expect(existsSync(destCss)).to.be.equal(true); contents = fs.readFileSync(destCss, 'utf8'); expect(contents).to.include('.outer .inner'); + expect(contents).to.include('.partial .inner'); process.chdir('..'); sh.exec('npm uninstall node-sass', { silent: true });