Open farfromrefug opened 5 years ago
Hi @farfromrefug ,
Currently all native code from plugins is collected based on the dependencies inside the package.json
and this was done by design. The main reason to do so is to support plugins that have only native code which is then consumed directly by the JavaScript/TypeScript code inside the application.
We agree that this approach has its downsides and we are currently discussing different options to handle situations like yours. The problem is somewhat complex and we will need some time to evaluate all options. Will update the issue when we have some progress on the matter.
@KristianDD Sure i get the difficulty. Great to know you are looking at solutions. Not actually a big deal right now but it is true that it is something that needs to be fixed. Thanks for your quick answer
I now use
webpack-strip-block
in my app to remove code in production. The idea behind this is to be able to usenativescript-vue-devtools
in dev but obviously remove it in production. So i add this to my webpackand in my app i do something like this:
This works perfectly and the code is removed in prod. So
nativescript-dev-tools
is not packd in prod. But remains the issue of the native version of the modules.nativescript-dev-tools
depends onnativescript-socket-io
which has native lib. My issue is thatnativescript-socket-io
native lib will always be packed with my app even if ``nativescript-dev-toolsis stripped and then
nativescript-socket-io``` not packaged.The list of native module to be added by filtering used packages after webpack compilation (not sure how that list is created right now). It should not be based on the package.json
Hope that issue makes sense