We have a Meteor application with some large image files for a slider.
我们有一个Meteor应用程序,带有一些滑块的大图像文件。
We show the images on the desktop app, but want to exclude the images in the mobile apps because they are not necessary in the mobile app and are downloaded every time a new version is published.
我们在桌面应用上显示图像,但希望在移动应用中排除图像,因为它们在移动应用中不是必需的,并且每次发布新版本时都会下载。
Is there any way to exclude files e.g. in the public folder when bundling the cordova app?
有没有办法排除文件,例如在捆绑cordova应用程序时在公用文件夹中?
2 个解决方案
#1
0
Files in the public folder are not automatically sent to the client unless requested by some template or javascript. In my app for example I send lower resolution images if I detect a mobile device. The folder has images in multiple resolutions but only the right one is sent.
除非某些模板或javascript请求,否则公用文件夹中的文件不会自动发送到客户端。例如,在我的应用中,如果我检测到移动设备,则会发送较低分辨率的图像。该文件夹具有多种分辨率的图像,但只发送了正确的图像。
#2
0
So the IMHO best solution to this problem is to put the images into a package that uses the addFiles function to include the images only in the desktop application.
因此,恕我直言这个问题的最佳解决方案是将图像放入一个使用addFiles函数的包中,只在桌面应用程序中包含图像。
Here's a link to the Cordova specific API you could use: https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration
以下是您可以使用的Cordova特定API的链接:https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration
#1
0
Files in the public folder are not automatically sent to the client unless requested by some template or javascript. In my app for example I send lower resolution images if I detect a mobile device. The folder has images in multiple resolutions but only the right one is sent.
除非某些模板或javascript请求,否则公用文件夹中的文件不会自动发送到客户端。例如,在我的应用中,如果我检测到移动设备,则会发送较低分辨率的图像。该文件夹具有多种分辨率的图像,但只发送了正确的图像。
#2
0
So the IMHO best solution to this problem is to put the images into a package that uses the addFiles function to include the images only in the desktop application.
因此,恕我直言这个问题的最佳解决方案是将图像放入一个使用addFiles函数的包中,只在桌面应用程序中包含图像。
Here's a link to the Cordova specific API you could use: https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration
以下是您可以使用的Cordova特定API的链接:https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration