Skip to content

Commit e2ccd8f

Browse files
Remove node_modules when preparing nativescript plugins
When preparing nativescript plugins, we copy the whole directory to the native project. This leads to a problem that node_modules dir of such plugins is also copied, while it should be flattened. CLI had already flatten it, but the copy of node_modules is never deleted and we receive `.aar` files in iOS projects for example.
1 parent bc80be9 commit e2ccd8f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/services/plugins-service.ts

+2
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ export class PluginsService implements IPluginsService {
131131
platformData.platformProjectService.preparePluginNativeCode(pluginData).wait();
132132

133133
shelljs.rm("-rf", path.join(pluginDestinationPath, pluginData.name, "platforms"));
134+
// Remove node_modules of the plugin. The destination path should have flattened node_modules.
135+
shelljs.rm("-rf", path.join(pluginDestinationPath, pluginData.name, constants.NODE_MODULES_FOLDER_NAME));
134136

135137
// Show message
136138
this.$logger.out(`Successfully prepared plugin ${pluginData.name} for ${platform}.`);

0 commit comments

Comments
 (0)