Skip to content

Commit

Permalink
fix: correctly resolve style modules
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed May 5, 2021
1 parent 9d89358 commit dd2f331
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions plugins/value-no-unknown-custom-properties/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ async function getCustomPropertiesFromRoot(root) {
const fileName = atRule.params
.replace(/url\(/, '')
.replace(/\)$/, '')
.replace(/['|"]/g, '');
const resolvedFileName = path.resolve(sourceDir, fileName);
.replace(/['|"]/g, '')
.replace(/^~/, '');
importPromises.push(resolve(fileName, {
basedir: sourceDir,
}).then(() => getCustomPropertiesFromCSSFile(resolvedFileName)));
extensions: ['.css'],
preserveSymlinks: true,
packageFilter(pkg) {
if (pkg.style) {
pkg.main = pkg.style;
}
return pkg;
},
}).then((resolvedFileName) => getCustomPropertiesFromCSSFile(resolvedFileName)));
});

const properties = await Promise.all(importPromises);
Expand Down

0 comments on commit dd2f331

Please sign in to comment.