File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ const vuePlugin = (opts: Options = {}) => <esbuild.Plugin>{
4848
4949 const cache = new AsyncCache ( ! opts . disableCache ) ;
5050
51+ const projectRoot = process . env . npm_config_local_prefix || process . cwd ( ) ;
52+
5153 const transforms : Record < string , core . DirectiveTransform > = { } ;
5254 if ( opts . directiveTransforms ) {
5355 for ( const name in opts . directiveTransforms ) {
@@ -269,12 +271,12 @@ const vuePlugin = (opts: Options = {}) => <esbuild.Plugin>{
269271 postcssPlugins : opts . postcss ?. plugins ,
270272 preprocessLang : style . lang as any ,
271273 preprocessOptions : Object . assign ( {
272- includePaths : [
273- path . dirname ( args . path )
274+ loadPaths : [
275+ path . dirname ( args . path ) ,
276+ path . resolve ( projectRoot , "node_modules" ) ,
274277 ] ,
275278 importer : {
276279 findFileUrl ( url : string ) {
277- const projectRoot = process . env . npm_config_local_prefix || process . cwd ( )
278280 const modulePath = path . join ( projectRoot , "node_modules" , url )
279281
280282 if ( fs . existsSync ( modulePath ) ) return pathToFileURL ( modulePath )
You can’t perform that action at this time.
0 commit comments