简体   繁体   English

Cordova - 在构建时忽略文件夹

[英]Cordova - Ignore folders on build

I've got a simple app for Phonegap. 我有一个简单的Phonegap应用程序。 In the www folder I added some NPM sugar to help development. www文件夹中,我添加了一些NPM糖来帮助开发。 Now, during the build I'd like to ignore this node_module folder created by NPM when it loads the dependencies. 现在,在构建期间,我想忽略NPM在加载依赖项时创建的node_module文件夹。 It actually make the build fail. 它实际上使构建失败。

I've added an ant.properties file within root/platforms/android/ and wrote this line: 我在root/platforms/android/添加了一个ant.properties文件并编写了这一行:

aapt.ignore.assets:!.svn:!.git:.*:<dir>_*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~:<dir>node_*

It prints that it ignores the folder node_modules because of that property, but when I look at the folder root/platforms/android/assets/www I can see the node_modules folder. 由于该属性,它打印它忽略文件夹node_modules,但是当我查看文件夹root/platforms/android/assets/www我可以看到node_modules文件夹。

I guess my question is, is the folder actually being ignored in the created APK? 我想我的问题是,在创建的APK中文件夹实际被忽略了吗?

Make a copy of your APK and change the file extension from .apk to .zip then extract the zip. 复制APK并将文件扩展名从.apk更改为.zip然后解压缩。 You will be able to browse to the www folder and see if it's in there or not. 您将能够浏览到www文件夹,看看它是否在那里。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM