Browse Source

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

pointhalo 2 years ago
parent
commit
a3ce70e6c7
1 changed files with 1 additions and 1 deletions
  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`;
 
     try {
-        require.resolve(`${theme}/scss/animation.scss`);
+        resolve.sync(this.context, `${theme}/scss/animation.scss`);
     } catch (e) {
         animationStr = ""; // fallback to empty string
     }