Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
feat(sass): add option to pass addition postcss plugins (#369)
Browse files Browse the repository at this point in the history
* feat(sass): add option to pass addition postcss plugins

* chore(SassConfig): make postCssPlugins optional
  • Loading branch information
alan-agius4 authored and danbucholtz committed Apr 21, 2017
1 parent fa5e52c commit be30a40
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,16 @@ function renderSassSuccess(context: BuildContext, sassResult: Result, sassConfig

Logger.debug(`sass, start postcss/autoprefixer`);

return postcss([autoprefixer(sassConfig.autoprefixer)])
let postCssPlugins = [autoprefixer(sassConfig.autoprefixer)];

if (sassConfig.postCssPlugins) {
postCssPlugins = [
...sassConfig.postCssPlugins,
...postCssPlugins
];
}

return postcss(postCssPlugins)
.process(sassResult.css, postcssOptions).then((postCssResult: any) => {
postCssResult.warnings().forEach((warn: any) => {
Logger.warn(warn.toString());
Expand Down Expand Up @@ -441,14 +450,15 @@ export interface SassConfig {
excludeModules?: string[];
includeFiles?: RegExp[];
excludeFiles?: RegExp[];
directoryMaps?: {[key: string]: string};
directoryMaps?: { [key: string]: string };
sortComponentPathsFn?: (a: any, b: any) => number;
sortComponentFilesFn?: (a: any, b: any) => number;
variableSassFiles?: string[];
autoprefixer?: any;
sourceMap?: string;
omitSourceMapUrl?: boolean;
sourceMapContents?: boolean;
postCssPlugins?: any[];
}


Expand Down

0 comments on commit be30a40

Please sign in to comment.