Closed bagnos closed 4 years ago
@bagnos,
The bundle.js
and vendor.js
files inside platforms directory are automatically generated files by webpack compilation. All modules from application are produced in bundle.js
file and all modules from node_modules
e.g all dependencies of the application are outputted in vendor.js
.
I have a Module shared between the feature modules, how can I move it to vendor.js?
Why do you need to move the module to vendor.js
? Can you give us more details about your particular use case?
hi,
the shared module is imported in all of the feature modules, so in the chunks I can see that module many times, see below. If I could move it to vendor.js I improved size e boot time (snapshot) I see that in this old link https://www.youtube.com/watch?v=7rHnLb-2tZ4.
[image: image.png]
On Tue, Oct 22, 2019 at 2:37 PM Fatme notifications@github.com wrote:
@bagnos https://github.com/bagnos,
The bundle.js and vendor.js files inside platforms directory are automatically generated files by webpack compilation. All modules from application are produced in bundle.js file and all modules from node_modules e.g all dependencies of the application are outputted in vendor.js.
I have a Module shared between the feature modules, how can I move it to vendor.js?
Why do you need to move the module to vendor.js? Can you give us more details about your particular use case?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NativeScript/nativescript-dev-webpack/issues/1074?email_source=notifications&email_token=ABQFBKQ4DEREIB4UEAIBUADQP3XYVA5CNFSM4JDOMBEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB5SK3Q#issuecomment-544941422, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQFBKQDT4JQMMD3774DS7DQP3XYVANCNFSM4JDOMBEA .
You can change this in your webpack.config.json
(https://github.com/NativeScript/nativescript-dev-webpack/blob/master/demo/AngularApp/webpack.config.js#L169). If that test returns true for your file it gets bundled in vendor.js
Thanks so much @edusperoni !
It works.
Hi,
I'm using the latest version of nativescript-dev-webpack, I see that the plugin imported are now moved automatically in vendor.js . There's non need to create src/vendor.ts and put the import in it. I have a Module shared between the feature modules, how can I move it to vendor.js? I tried to create the src/vendor.ts but by webpack analyzer I keep seeing them in the feature modules.
Can you help me?