Skip to content

Commit

Permalink
fix: use require.resolve from compiler.context
Browse files Browse the repository at this point in the history
  • Loading branch information
colinaaa committed Dec 28, 2024
1 parent b99af2e commit 9c9008b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TailwindCSSRspackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ class TailwindRspackPluginImpl {

async #resolveTailwindCSSVersion(): Promise<string> {
const require = createRequire(import.meta.url);
const pkgPath = require.resolve('tailwindcss/package.json');
const pkgPath = require.resolve('tailwindcss/package.json', {
paths: [this.compiler.context],
});

const content = await readFile(pkgPath, 'utf-8');

Expand Down

0 comments on commit 9c9008b

Please sign in to comment.