Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dojo 1.7 custom build - How to remove unused files from the release folder

I have used the below (1.7) custom build profile to build my release folder.

var profile = {
basePath: "..",
action: "release",
cssOptimize: "comments",
mini: true,
optimize: "closure",
layerOptimize: "closure",
stripConsole: "all",
selectorEngine: "acme",
packages:[
    {
        name: "dojo",
        location: "./../../dojo"
    },

    {
        name: "dijit",
        location: "./../../dijit"
    },

    {
        name: "dojox",
        location: "./../../dojox"
    }
],

layers: {
    "dojo/dojo": {
        include: [
                            "dojo/dojo",
                            "dijit/form/Button",
                            "dojox/form/TimeSpinner"
                    ],
        customBase: true,
        boot: true
    }
},

resourceTags: {
    amd: function (filename, mid) {
        return /\.js$/.test(filename);
    }
} };

In my web application, I am using just two components, one is Button from 'dijit' package and another one is TimeSpinner from 'dojox'. So, I have included these two components in to 'dojo/dojo.js' file, it is working as I have expected.

But the release folder contains the folders 'dojo', 'dijit' and 'dojox' with lot of files.

Most of the components are not used in my web application, but their files are present in the release folder. Even though they will not be loaded in to the browser (because of AMD), I don't want to have such files in my release folder.

It is unnecessary to maintain such huge number of files in my subversion.

So, my questions are below:

  1. How to remove '.uncompressed.js' files from the release folder?
  2. How to remove the files, CSS, templates of unused components from the release folder ?

Please help me...

like image 415
sokid Avatar asked May 21 '12 09:05

sokid


1 Answers

You can add the following lines at the bottom of build.sh

find . -type f -name '*.uncompressed.js' -print0 | xargs -0 rm -rdf

find . -type f -name '*.consoleStripped.js' -print0 | xargs -0 rm -rdf 
like image 189
Manu Avatar answered Sep 19 '22 13:09

Manu