javascripttypescriptwebpacknativescriptnativescript-angular

NativeScript Version 8.2.1 : how to use old outdated plugins


I am new to NativeScript and Webpack and i have migrated my native script app from 6.5.1 to 8.2 version, and i am using nativescript-orientation-free plugin ,i am getting build errors as this plugin still refers to tns-core-modules which is no longer supported in Native Script 8 and i am getting below errors

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 17:12-48 Module not found: Error: Can't resolve 'tns-core-modules/ui/enums' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 18:12-48 Module not found: Error: Can't resolve 'tns-core-modules/ui/frame' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

we do not want to use this paid version pro-plugins-nativescript-orientation

orientation.js

can you please let me know how can i fix this issue? is there anything i can do in the webpack.config.js ? I am stuck here.


Solution

  • i removed this plugin and able to set the orientation without any third party plugins using

    UIDevice.currentDevice.setValueForKey(1, "orientation");