Skip to content

Commit

Permalink
Revert app.js back to cmv default and ignore app.js via the profile.
Browse files Browse the repository at this point in the history
  • Loading branch information
green3g committed May 12, 2016
1 parent 3f89efc commit 0e5224f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 44 deletions.
67 changes: 34 additions & 33 deletions package.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,68 @@ var profile = (function () {
//only copy files matching these expressions
//this prevents them from being evaluated as amd modules
var reCopyOnly = [
/Gruntfile/,
/package/
];
/Gruntfile/,
/package/,
/app\.js/
];
//exclude from builds completely
var reMiniExclude = [
/Gruntfile/,
/package/
var reMiniExclude = [
/Gruntfile/,
/package/
];
//non-amd modules
var reNonAmd = [
/plugins\/Google/
];
/plugins\/Google/
];
return {
// Resource tags are functions that provide hints to the build system about the way files should be processed.
// Each of these functions is called once for every file in the package directory. The first argument passed to
// the function is the filename of the file, and the second argument is the computed AMD module ID of the file.
resourceTags: {
resourceTags: {
// Files that contain test code and should be excluded when the `copyTests` build flag exists and is `false`.
// It is strongly recommended that the `mini` build flag be used instead of `copyTests`. Therefore, no files
// are marked with the `test` tag here.
test: function (filename, mid) {
return false;
},
test: function (filename, mid) {
return false;
},

// Files that should be copied as-is without being modified by the build system.
// All files in the `app/resources` directory that are not CSS files are marked as copy-only, since these files
// are typically binaries (images, etc.) and may be corrupted by the build system if it attempts to process
// them and naively assumes they are scripts.
copyOnly: function (filename, mid) {
for (var i = 0; i < reCopyOnly.length; i++) {
if (reCopyOnly[i].test(filename)) {
return true;
copyOnly: function (filename, mid) {
for (var i = 0; i < reCopyOnly.length; i++) {
if (reCopyOnly[i].test(filename)) {
return true;
}
}
}
return (/\/(images)\//.test(mid) && !/\.css$/.test(filename)) ||
return (/\/(images)\//.test(mid) && !/\.css$/.test(filename)) ||
/\/node_modules\//.test(mid);
},
},

// Files that are AMD modules.
// All JavaScript in this package should be AMD modules if you are starting a new project. If you are copying
// any legacy scripts from an existing project, those legacy scripts should not be given the `amd` tag.
amd: function (filename, mid) {
for (var i = 0; i < reNonAmd.length; i++) {
if (reNonAmd[i].test(filename)) {
return false;
amd: function (filename, mid) {
for (var i = 0; i < reNonAmd.length; i++) {
if (reNonAmd[i].test(filename)) {
return false;
}
}
}
return !this.copyOnly(filename, mid) && /\.js$/.test(filename);
},
return !this.copyOnly(filename, mid) && /\.js$/.test(filename);
},

// Files that should not be copied when the `mini` build flag is set to true.
// In this case, we are excluding this package configuration file which is not necessary in a built copy of
// the application.
miniExclude: function (filename, mid) {
for (var i = 0; i < reMiniExclude.length; i++) {
if (reMiniExclude[i].test(filename)) {
return true;
miniExclude: function (filename, mid) {
for (var i = 0; i < reMiniExclude.length; i++) {
if (reMiniExclude[i].test(filename)) {
return true;
}
}
return false;
return false;
}
}
}
};
};
})();
19 changes: 8 additions & 11 deletions viewer/js/config/app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
define(['dojo/_base/window'], function (window) {

var path = window.global.location.pathname.replace(/[^\/]+$/, '');
var dojoConfig = window.global.dojoConfig = {
(function () {
var path = location.pathname.replace(/[^\/]+$/, '');
window.dojoConfig = {
async: true,
packages: [
{
Expand All @@ -13,9 +12,6 @@ define(['dojo/_base/window'], function (window) {
}, {
name: 'config',
location: path + 'js/config'
}, {
name: 'proj4js',
location: '//cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12'
}, {
name: 'put-selector',
main: 'put',
Expand All @@ -24,11 +20,14 @@ define(['dojo/_base/window'], function (window) {
name: 'xstyle',
main: 'css',
location: 'https://cdn.rawgit.com/kriszyp/xstyle/v0.3.2'
}, {
name: 'proj4js',
location: '//cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12'
}
]
};

require(dojoConfig, [
require(window.dojoConfig, [
'dojo/_base/declare',

// minimal Base Controller
Expand Down Expand Up @@ -65,6 +64,4 @@ define(['dojo/_base/window'], function (window) {
]))();
controller.startup();
});
//we have to return something
return dojoConfig;
});
})();

0 comments on commit 0e5224f

Please sign in to comment.