@@ -167,9 +167,9 @@ const prepareBuild = async (build, options) => {
167167 */
168168const onResolveModulesCss = async ( args , build ) => {
169169 const { resolve, initialOptions, context } = build ;
170- const { resolveDir, path : p , pluginData = { } } = args ;
170+ const { resolveDir, path : p , pluginData = { } , kind } = args ;
171171 const { log, relative } = context ;
172- const { path : absPath } = await resolve ( p , { resolveDir } ) ;
172+ const { path : absPath } = await resolve ( p , { resolveDir, kind } ) ;
173173 const rpath = relative ( absPath ) ;
174174 log ( 'resolve' , p , 'to' , rpath , 'from build root' ) ;
175175
@@ -455,13 +455,13 @@ const setup = async (build, options) => {
455455 const builtModulesCssRegExp = getBuiltModulesCssRegExp ( options ) ;
456456
457457 // resolve xxx.module.css to xxx.module.css?esbuild-css-modules-plugin-building
458- build . onResolve ( { filter : modulesCssRegExp , namespace : 'file' } , async ( args ) => {
459- return await onResolveModulesCss ( args , build ) ;
458+ build . onResolve ( { filter : modulesCssRegExp , namespace : 'file' } , ( args ) => {
459+ return onResolveModulesCss ( args , build ) ;
460460 } ) ;
461461
462462 // load xxx.module.css?esbuild-css-modules-plugin-building
463- build . onLoad ( { filter : modulesCssRegExp , namespace : pluginNamespace } , async ( args ) => {
464- return await onLoadModulesCss ( build , options , args ) ;
463+ build . onLoad ( { filter : modulesCssRegExp , namespace : pluginNamespace } , ( args ) => {
464+ return onLoadModulesCss ( build , options , args ) ;
465465 } ) ;
466466
467467 // resolve virtual path xxx.module.css?esbuild-css-modules-plugin-built
@@ -470,8 +470,8 @@ const setup = async (build, options) => {
470470 filter : builtModulesCssRegExp ,
471471 namespace : pluginNamespace
472472 } ,
473- async ( args ) => {
474- return await onResolveBuiltModulesCss ( args , build ) ;
473+ ( args ) => {
474+ return onResolveBuiltModulesCss ( args , build ) ;
475475 }
476476 ) ;
477477
@@ -481,13 +481,13 @@ const setup = async (build, options) => {
481481 filter : builtModulesCssRegExp ,
482482 namespace : pluginNamespace
483483 } ,
484- async ( args ) => {
485- return await onLoadBuiltModulesCss ( args , build ) ;
484+ ( args ) => {
485+ return onLoadBuiltModulesCss ( args , build ) ;
486486 }
487487 ) ;
488488
489489 build . onEnd ( async ( result ) => {
490- await onEnd ( build , options , result ) ;
490+ onEnd ( build , options , result ) ;
491491 } ) ;
492492} ;
493493
0 commit comments