1

I need to exclude from my build file ending/containing

.js.map  

and

.js.uncompressed.js

I am trying using some regex with no success

        ignore: function(t) {
            return /\.js.map$/.test(t)
        },
        miniExclude: function(t) {
            return /\.js.map$/.test(t)
        }

I am using DOJO 1.10.

What am I doing wrong here?


var profile = function() {
    return {
        basePath: "../",
        releaseDir: "dist",
        releaseName: "build",
        optimize: "closure",
        action: "release",
        layerOptimize: "closure",
        copyTests: !1,
        stripConsole: "all",
        version: "ntv-0.0.0",
        cssOptimize: "comments",
        mini: !0,
        staticHasFeatures: {
            "dojo-trace-api": !1,
            "dojo-log-api": !1,
            "dojo-publish-privates": !1,
            "dojo-sync-loader": !1,
            "dojo-xhr-factory": !1,
            "dojo-test-sniff": !1
        },
        resourceTags: {
            amd: function(t) {
                return /\.js$/.test(t)
            },
            ignore: function(t) {
                return /\.js.map$/.test(t)
            },
            miniExclude: function(t) {
                return /\.js.map$/.test(t)
            }
        },
        packages: [{
            name: "dojo",
            location: "dojo"
        }, {
            name: "test",
            location: "test"
        }],
        layers: {
            "dojo/dojo": {
                include: ["dojo/dojo"],
                customBase: !0,
                boot: !0
            },
            "test/c": {
                include: ["test/c/c"],
                customBase: !0,
                boot: !1
            },
            "test/b": {
                include: ["test/b/b"],
                customBase: !0,
                boot: !1
            },
            "test/a": {
                include: ["test/a/a"],
                customBase: !0,
                boot: !1
            }
        }
    }
}();
GibboK
  • 71,848
  • 143
  • 435
  • 658
  • a regex suggesion is also very welcome :) – GibboK Feb 17 '15 at 14:58
  • related: http://stackoverflow.com/questions/19409720/how-to-exclude-files-from-dojos-build-system – GibboK Feb 17 '15 at 15:27
  • 1
    you could delete the files by adding the following lines at the end of the `build.sh` script. `find . -name \*.uncompressed.js -type f -delete` and `find . -name \*.js.map -type f -delete`. The above command is for Linux systems only. – frank Feb 17 '15 at 17:01
  • Thanks for your comment, do you have an idea how could be the command for window? – GibboK Feb 17 '15 at 17:35
  • 1
    for windows `del /s *.uncompressed.js` and `del /s *.js.map` – frank Feb 17 '15 at 17:39

2 Answers2

1

First of all, the word "exclude" used in the question isn't quite accurate. These are files that are generated by the build system - they're not files existing in the source to be excluded in the first place.

If you don't want the build to generate source maps, set useSourceMaps: false in your build profile.

As for the *.uncompressed.js files, the build generates these automatically for any module or layer that it minifies. If you really don't want them in the build output, you'll need to remove them afterwards with a command like frank suggested in the comments.

The reason both of these files are included ordinarily is to assist in debugging of built applications. Neither of these files will be downloaded by a browser during normal use; they will only be requested by developer tools.

Ken Franqueiro
  • 10,559
  • 2
  • 23
  • 40
0
"asd.js.uncompressed.js".match(/.{1,}\.(js\.map|js\.uncompressed\.js)$/g) //match
"khaslkda.js.map".match(/.{1,}\.(js\.map|js\.uncompressed\.js)$/g) //match
"khaslkda.map".match(/.{1,}\.(js\.map|js\.uncompressed\.js)$/g) // no match
"khaslkda.map.js".match(/.{1,}\.(js\.map|js\.uncompressed\.js)$/g) //no match

I don't really know dojo. But this regex might help you?

edit: I used match.. but it should work with test as well. Just do like this

/.{1,}\.(js\.map|js\.uncompressed\.js)$/g.test("as-_d.js.uncompressed.js") //true
springbo
  • 1,096
  • 1
  • 9
  • 15