Skip to content

Commit b419c21

Browse files
authored
Merge pull request #4981 from NativeScript/vladimirov/update-react-svelte
fix: tns update will not modify webpack.config.js of React/Svelte projects
2 parents 7faf9b9 + 6568e7e commit b419c21

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/controllers/update-controller.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ export class UpdateController extends UpdateControllerBase implements IUpdateCon
8787
this.$fs.deleteDirectory(path.join(projectData.projectDir, constants.HOOKS_DIR_NAME));
8888
this.$fs.deleteDirectory(path.join(projectData.projectDir, constants.PLATFORMS_DIR_NAME));
8989
this.$fs.deleteDirectory(path.join(projectData.projectDir, constants.NODE_MODULES_FOLDER_NAME));
90-
this.$fs.deleteFile(path.join(projectData.projectDir, constants.WEBPACK_CONFIG_NAME));
90+
if (projectData.projectType === constants.ProjectTypes.ReactFlavorName || projectData.projectType === constants.ProjectTypes.SvelteFlavorName) {
91+
this.$logger.warn(`As this project is of type ${projectData.projectType}, CLI will not update its ${constants.WEBPACK_CONFIG_NAME} file. Consider updating it manually.`);
92+
} else {
93+
this.$fs.deleteFile(path.join(projectData.projectDir, constants.WEBPACK_CONFIG_NAME));
94+
}
9195
this.$fs.deleteFile(path.join(projectData.projectDir, constants.PACKAGE_LOCK_JSON_FILE_NAME));
9296
this.$logger.info("Clean old project artefacts complete.");
9397
}

0 commit comments

Comments
 (0)