@@ -855,24 +855,17 @@ export class BundlerCompilerService
855855 return path . resolve ( packagePath , "bin" , "vite.js" ) ;
856856 }
857857 } else if ( this . isModernBundler ( projectData ) ) {
858- const packagePath = resolvePackagePath ( `@nativescript/${ bundler } ` , {
858+
859+ const webpackPluginName = this . $projectConfigService . getValue ( `webpackPackageName` , WEBPACK_PLUGIN_NAME ) ;
860+ const packagePath = resolvePackagePath ( webpackPluginName , {
859861 paths : [ projectData . projectDir ] ,
860862 } ) ;
861863
862864 if ( packagePath ) {
863865 return path . resolve ( packagePath , "dist" , "bin" , "index.js" ) ;
864866 }
865867 }
866-
867- const packagePath = resolvePackagePath ( "webpack" , {
868- paths : [ projectData . projectDir ] ,
869- } ) ;
870-
871- if ( ! packagePath ) {
872- return "" ;
873- }
874-
875- return path . resolve ( packagePath , "bin" , "webpack.js" ) ;
868+ throw new Error ( 'could not find bundler executable' ) ;
876869 }
877870
878871 private isModernBundler ( projectData : IProjectData ) : boolean {
@@ -881,7 +874,8 @@ export class BundlerCompilerService
881874 case "rspack" :
882875 return true ;
883876 default :
884- const packageJSONPath = resolvePackageJSONPath ( WEBPACK_PLUGIN_NAME , {
877+ const webpackPluginName = this . $projectConfigService . getValue ( `webpackPackageName` , WEBPACK_PLUGIN_NAME ) ;
878+ const packageJSONPath = resolvePackageJSONPath ( webpackPluginName , {
885879 paths : [ projectData . projectDir ] ,
886880 } ) ;
887881
0 commit comments