Skip to content

Commit

Permalink
fix(index): postcss.config.js not resolved correctly (`options.conf…
Browse files Browse the repository at this point in the history
…ig`)
  • Loading branch information
michael-ciniawsky committed May 10, 2017
1 parent 4f20c99 commit faaeee4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,25 @@ module.exports = function loader (css, map) {
validateOptions(require('./options.json'), options, 'PostCSS Loader')

const rc = {
path: '',
path: path.dirname(file),
ctx: {
file: {
extname: path.extname(file),
dirname: path.dirname(file),
basename: path.basename(file)
}
},
options: {}
}
}

if (options.config) {
options.config.path
? rc.path = path.resolve(options.config.path)
: rc.path = path.dirname(file)
if (options.config.path) {
rc.path = path.resolve(options.config.path)
}

options.config.ctx
? rc.ctx.options = options.config.ctx
: rc.ctx.options = {}
if (options.config.ctx) {
rc.ctx.options = options.config.ctx
}
}

const sourceMap = options.sourceMap
Expand Down

0 comments on commit faaeee4

Please sign in to comment.