From 305caa8cb0d9cba809e31c2a27be477a3dd2ad0e Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Mon, 5 Aug 2019 16:25:58 +0800 Subject: [PATCH] fix: regex for check module path --- packages/ice-skin-loader/lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ice-skin-loader/lib/index.js b/packages/ice-skin-loader/lib/index.js index 3c264be..d3b9b43 100644 --- a/packages/ice-skin-loader/lib/index.js +++ b/packages/ice-skin-loader/lib/index.js @@ -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}";`; }