If you want to achieve this, you'll need to create a new package. Here's a simple step-by-step guide:
1) If your project doesn't already have a packages
folder, create one
2) Within the packages
folder, create a directory named mobileapp
3) Inside the mobileapp
directory, create a file called package.js
with the following contents:
Package.describe({
summary: "For cordova use only",
});
Package.on_use(function (api) {
if(api.versionsFrom) api.versionsFrom("<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="83cec6d7c6ccd1c3b2adb3">[email protected]</a>");
api.use(['ground:db'], ['web.cordova']);
});
After that, navigate to your meteor's root directory and run the command:
meteor add mobile
This will ensure that the ground:db
package is only added in your cordova
builds, without including any unnecessary source code in web builds.
In the Package.on_use
method, you can also specify additional files to include using api.add_files with web.cordova
as the architecture, ensuring that only specified files are included in cordova builds but not web app builds.
By following this approach, you can optimize your web app without compromising its functionality.