Skip to content

Commit

Permalink
feat: 升级对于配置的解析
Browse files Browse the repository at this point in the history
  • Loading branch information
zengxuebing committed Apr 15, 2020
1 parent ef92f27 commit e9ac2d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "postcss-color-variable",
"version": "0.2.1",
"version": "0.2.2",
"description": "PostCSS plugin color variable",
"keywords": [
"postcss",
Expand Down
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ function resolveConfigFilesPath (filePaths, configPath) {

const folder = getPathFolder(configPath)
return path.resolve(folder, filePath)

return filePath
})
}

Expand All @@ -61,7 +59,7 @@ function resolveConfig (config, configPath) {
const aliasPath = alias[key]
const absolutePath = resolveConfigFilePath(aliasPath, configPath)

if (path.isAbsolute((absolutePath))) {
if (path.isAbsolute(absolutePath)) {
result[key] = absolutePath
return result
}
Expand Down Expand Up @@ -95,7 +93,7 @@ function resolveOpts (opts) {
}

function getConfig (opts) {
return Object.assign({}, DefaultConfig, resolveFileConfig(opts.searchFrom), resolveOpts(opts))
return Object.assign({}, DefaultConfig, resolveFileConfig(opts.searchFrom), resolveOpts(opts, opts.configPath))
}

module.exports = postcss.plugin('postcss-color-variable', (opts = {}) => {
Expand Down

0 comments on commit e9ac2d0

Please sign in to comment.