Skip to content

Commit 9fda013

Browse files
committed
chore: fix after merge to support custom webpack plugin in place of @nativescript/webpack
1 parent f46c90f commit 9fda013

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

lib/services/bundler/bundler-compiler-service.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)