Преглед изворни кода

fix: some project can't resolve animation.scss with pnpm, lost animation css variable

pointhalo пре 2 година
родитељ
комит
a3ce70e6c7
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      packages/semi-webpack/src/semi-theme-loader.ts

+ 1 - 1
packages/semi-webpack/src/semi-theme-loader.ts

@@ -11,7 +11,7 @@ export default function SemiThemeLoader(source: string) {
     let animationStr = `@import "~${theme}/scss/animation.scss";\n`;
     let animationStr = `@import "~${theme}/scss/animation.scss";\n`;
 
 
     try {
     try {
-        require.resolve(`${theme}/scss/animation.scss`);
+        resolve.sync(this.context, `${theme}/scss/animation.scss`);
     } catch (e) {
     } catch (e) {
         animationStr = ""; // fallback to empty string
         animationStr = ""; // fallback to empty string
     }
     }