Skip to content

Commit

Permalink
Set up build for Store Package.
Browse files Browse the repository at this point in the history
  • Loading branch information
xirzec committed Nov 4, 2014
1 parent 3b216e2 commit c7877f9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
14 changes: 14 additions & 0 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@
// Register external tasks
grunt.loadTasks("tasks/");

grunt.registerTask("configureStore", function () {
config.isStorePackage = true;

// the configuration for ui is already mixed in when requirejs options are loaded
// so we have to override the path to the Telemetry implementation manually
var requirejs = grunt.config.get("requirejs");
var merge = { requirejs: {} };
var ui = requirejs["ui"];
ui.options.paths["WinJS/Utilities/_Telemetry"] = "./WinJS/Utilities/_TelemetryImpl";
merge.requirejs["ui"] = ui;
grunt.config.merge(merge);
});

// Tasks that drop things in bin/ (should have "add-bom" as the last task)
grunt.registerTask("storePackage", ["configureStore", "default"]);
grunt.registerTask("default", ["clean", "check-file-names", "ts", "build-qunit", "less", "concat", "_build", "_copyFinal", "replace", "add-bom"]);
grunt.registerTask("quick", ["clean", "ts:src", "less", "concat", "_quickBuild", "add-bom"]);

Expand Down
10 changes: 8 additions & 2 deletions tasks/options/requirejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@
"WinJS.js",
"WinJS/css",
"WinJS/Core",
"WinJS/Controls/AppBar"
"WinJS/Controls/AppBar",
"WinJS/Utilities/_TelemetryImpl.js"
];
toRemove.forEach(function (item) {
fs.removeSync(path.join(config.modulesOutput, item));
Expand Down Expand Up @@ -291,9 +292,14 @@
options.paths = {
"less": "../../src/less",
"require-json": "../../tasks/utilities/require-json",
"require-style": "../../tasks/utilities/require-style"
"require-style": "../../tasks/utilities/require-style",
};

// this is to reconfigure onefile dependencies
if (config.isStorePackage) {
options.paths["WinJS/Utilities/_Telemetry"] = "./WinJS/Utilities/_TelemetryImpl";
}

// The modules build generates a require configuration with this
if (!options.dir) {
options.name = options.name || key;
Expand Down

0 comments on commit c7877f9

Please sign in to comment.