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

feat(sass): add option to pass addition postcss plugins #369

Merged
merged 2 commits into from
Apr 21, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/sass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,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 @@ -446,14 +455,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