Skip to content

Commit

Permalink
Allow absolute path as config option (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored and ai committed Dec 12, 2016
1 parent 3b6e991 commit f0fb3f1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@ module.exports = function (source, map) {
var options = params.plugins || loader.options.postcss;
var pack = params.pack;
var callback = loader.async();
var configPath = params.config ?
path.join(process.cwd(), params.config) : path.dirname(file);
var configPath;

if (params.config) {
if (path.isAbsolute(params.config)) {
configPath = params.config;
} else {
configPath = path.join(process.cwd(), params.config);
}
} else {
configPath = path.dirname(file);
}

Promise.resolve().then(function () {
if ( typeof options !== 'undefined' ) {
Expand Down

0 comments on commit f0fb3f1

Please sign in to comment.