forked from winjs/winjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
onefile.js
27 lines (23 loc) · 1003 Bytes
/
onefile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License.txt in the project root for license information.
(function () {
"use strict";
var copiedToTsBuild = false;
module.exports = function (grunt) {
grunt.registerTask("onefile", "build a single module into a full WinJS build", function (path) {
if (copiedToTsBuild) {
grunt.task.run(["_buildModule:" + path]);
} else {
grunt.task.run(["_copyToTsBuild", "_buildModule:" + path]);
copiedToTsBuild = true;
}
});
grunt.registerTask("_buildModule", "", function (path) {
var requirejs = grunt.config.get("requirejs");
var merge = { requirejs: {} };
var config = requirejs.defaults(path);
merge.requirejs[path] = config;
grunt.config.merge(merge);
grunt.task.run(["requirejs:" + path]);
});
};
})();