Skip to content

Commit 7b08661

Browse files
author
Fredrik Löwenhamn
committed
Getting project root from process.env.npm_config_local_prefix in compileStyle importer.
1 parent 2019587 commit 7b08661

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ const vuePlugin = (opts: Options = {}) => <esbuild.Plugin>{
267267
],
268268
importer: [
269269
(url: string) => {
270-
const modulePath = path.join(process.cwd(), "node_modules", url);
270+
const projectRoot = process.env.npm_config_local_prefix || process.cwd()
271+
const modulePath = path.join(projectRoot, "node_modules", url);
271272

272273
if (fs.existsSync(modulePath)) {
273274
return { file: modulePath }

0 commit comments

Comments
 (0)