Skip to content

Commit

Permalink
fix: regex for check module path
Browse files Browse the repository at this point in the history
  • Loading branch information
ClarkXia committed Aug 5, 2019
1 parent 930c337 commit 305caa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ice-skin-loader/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ module.exports = function (source) {
projectPkgData
&& projectPkgData.dependencies
&& projectPkgData.dependencies['@alifd/next']
&& !/^node_modules\//.test(modulePath)
&& !/^node_modules[\\/]/.test(modulePath)
) {
importVarsCode = `@import '~@alifd/next/lib/core/index.scss';`;
}

let prefixVars = '';
if (themeConfig.nextPrefix && /@alifd\/next\/lib\/(.+).scss$/.test(modulePath)) {
if (themeConfig.nextPrefix && /@alifd[\\/]next[\\/](lib|es)[\\/](.+).scss$/.test(modulePath)) {
// 将 next 1.x 的 prefix 从 next- 改为自定义前缀,解决 0.x&1.x 混用的问题
prefixVars = `$css-prefix: "${themeConfig.nextPrefix}";`;
}
Expand Down

0 comments on commit 305caa8

Please sign in to comment.