Skip to content

Commit c5e32a0

Browse files
committed
fix: support @akylas/nativescript-webpack
1 parent f23a4bf commit c5e32a0

3 files changed

Lines changed: 16 additions & 6 deletions

File tree

lib/controllers/migrate-controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export class MigrateController
147147
},
148148
{
149149
packageName: "nativescript-dev-webpack",
150-
replaceWith: "@nativescript/webpack",
150+
replaceWith: constants.WEBPACK_PLUGIN_NAME,
151151
shouldRemove: true,
152152
isDev: true,
153153
async shouldMigrateAction() {
@@ -156,7 +156,7 @@ export class MigrateController
156156
migrateAction: this.migrateWebpack.bind(this),
157157
},
158158
{
159-
packageName: "@nativescript/webpack",
159+
packageName: constants.WEBPACK_PLUGIN_NAME,
160160
minVersion: "3.0.0",
161161
desiredVersion: "~5.0.0",
162162
shouldAddIfMissing: true,
@@ -1566,7 +1566,7 @@ export class MigrateController
15661566
);
15671567

15681568
try {
1569-
const scopedWebpackPackage = `@nativescript/webpack`;
1569+
const scopedWebpackPackage = constants.WEBPACK_PLUGIN_NAME;
15701570
const resolvedVersion =
15711571
await this.$packageInstallationManager.getMaxSatisfyingVersion(
15721572
scopedWebpackPackage,

lib/controllers/update-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class UpdateController
3636

3737
// devDependencies
3838
{
39-
packageName: "@nativescript/webpack",
39+
packageName: constants.WEBPACK_PLUGIN_NAME,
4040
isDev: true,
4141
},
4242
{

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,14 @@ export class WebpackCompilerService
599599

600600
private getWebpackExecutablePath(projectData: IProjectData): string {
601601
if (this.isWebpack5(projectData)) {
602-
const packagePath = resolvePackagePath("@nativescript/webpack", {
602+
let packagePath = resolvePackagePath("@akylas/nativescript-webpack", {
603603
paths: [projectData.projectDir],
604604
});
605+
if (!packagePath) {
606+
packagePath = resolvePackagePath(WEBPACK_PLUGIN_NAME, {
607+
paths: [projectData.projectDir],
608+
});
609+
}
605610

606611
if (packagePath) {
607612
return path.resolve(packagePath, "dist", "bin", "index.js");
@@ -620,9 +625,14 @@ export class WebpackCompilerService
620625
}
621626

622627
private isWebpack5(projectData: IProjectData): boolean {
623-
const packageJSONPath = resolvePackageJSONPath("@nativescript/webpack", {
628+
let packageJSONPath = resolvePackageJSONPath("@akylas/nativescript-webpack", {
624629
paths: [projectData.projectDir],
625630
});
631+
if (!packageJSONPath) {
632+
packageJSONPath = resolvePackageJSONPath(WEBPACK_PLUGIN_NAME, {
633+
paths: [projectData.projectDir],
634+
});
635+
}
626636

627637
if (packageJSONPath) {
628638
const packageData = this.$fs.readJson(packageJSONPath);

0 commit comments

Comments
 (0)