Giter Club home page Giter Club logo

vs-cordova-ignore-files's Introduction

vs-cordova-ignore-files

Plugin removes unneeded files from VS Cordova Tools packaging operation

Forked by Firzenizer

This forked version of the plugin allows working with VS and PhoneGap Build. The files listed are removed before compiling. This allows you to keep icons/splashscreens under the www directory which is required by PhoneGap Build. This fork was tested using VS2015 comminity edition with Apache Cordova update 10.

What is it?

In Visual Studio 2013 with Visual Studio Tools for Apache Cordova CTP3.1 installed or Visual Studio 2015 CTP 6 the build or packaging operation for mobile hybrid apps includes EVERYTHING in your Visual Studio project in the resulting application package. This includes _references.js, packages.config and the template readme in addition to Typescript and unminified javascript files leading to code leakage and enormous useless bloat. Unlike other Visual Studio projects there is no built-in method for excluding files from the build at this time. Microsoft has assured us that as General Availability of VS 2015 approaches the situation will improve. For now this plugin will give you a great deal of control over which files land in your app package.

Installation

  1. Open \config.xml.
  2. Click Custom tab.
  3. Check Git.
  4. Paste the URL of this repo https://github.com/Firzenizer/vs-cordova-ignore-files
  5. Click the arrow button then click "Add" when it appears.

Usage

NEW A graphical documentation of the issue and plugin usage is located here.

The plugin consists of a default set of exclusions (*.ts, *.nupkg, _references.js, packages.config and Project_Readme.html) and 3 file types for specifying custom exclusions. Other than the default exclusions exclusions are only applied to build configurations other than Debug.

  • releaseignoreglobal.txt - 1 file name or file pattern per line located in the project root.
    • Patterns included here are applied globally throughout the project. For example to remove all javascript source maps place *.map in the file. To remove version.json anywhere it appears in the project add a line with version.json. You cannot specify directories in this file.
  • releaseignore.txt - 1 file name per line. The file must reside in the directory containing the listed files.
    • While subdirectory path syntax is permitted here it is not recommended. It is recommended to place another releaseignore.txt in the subdirectory. If path syntax is used use forward slashes with no leading slash (subdir/filename.ext).
    • Directories cannot be excluded in this file.
  • releaseignoredir.txt - An empty file placed in the directory to be excluded.
    • NEW Performs a recursive delete by default.
    • NEW Add recursive=false to the file to delete only the current directory. This will also allow releaseignore.txt to be used in subdirectories.

Unminified javascript exclusion

Part of the default action is to exclude unminified javascript when a minified (.min.js) file by the same name exists in the same directory as the minified version. Many libraries such as Ionic and AngularJS Nuget packages include both the minified and unminified versions in the same directory. Since the Cordova build packs both into app package this exclusion can reduce app package size by as much as half.

Applies to

The plugin has been extensively tested in Visual Studio 2013 with Visual Studio Tools for Apache Cordova CTP3.1 installed and Visual Studio 2015 CTP 6. It may, and should, work with earlier Cordova tools builds, but is not guaranteed.

The plugin will be maintained through any further Cordova tools releases until the functionality is no longer needed.

Credits

Original creator MagicBoxSoftware. I would like to thank Chuck Lantz - https://github.com/Chuxel - of Microsoft who answered my Stack Overflow question http://stackoverflow.com/questions/29684190/visual-studio-cordova-exclude-files/29704705 by writing a Cordova plugin to remove Typescript files from the build -> https://github.com/Chuxel/taco-tricks/tree/master/plugin-remove-typescript .

It was from that example that this plugin was inspired.

Other info

Another, more editorial, explanation of this plugin and its origins can be found on our web site.

vs-cordova-ignore-files's People

Contributors

morristime avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.