forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
39 lines (29 loc) · 1.18 KB
/
Copy pathindex.js
File metadata and controls
39 lines (29 loc) · 1.18 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
/*eslint-disable no-console */
// Prevent the dependency validation from tripping because we don't import zone.js. We need
// it as a peer dependency of @angular/core.
// require('zone.js')
// This file hooks up on require calls to transpile TypeScript.
const cli = require('../../ember-cli/lib/cli');
const UI = require('../../ember-cli/lib/ui');
const Watcher = require('../../ember-cli/lib/models/watcher');
const path = require('path');
Error.stackTraceLimit = Infinity;
module.exports = function(options) {
// patch UI to not print Ember-CLI warnings (which don't apply to Angular-CLI)
UI.prototype.writeWarnLine = function () { }
// patch Watcher to always default to node, not checking for Watchman
Watcher.detectWatcher = function(ui, _options){
var options = _options || {};
options.watcher = 'node';
return Promise.resolve(options);
}
options.cli = {
name: 'ng',
root: path.join(__dirname, '..', '..'),
npmPackage: 'angular-cli'
};
// ensure the environemnt variable for dynamic paths
process.env.PWD = process.env.PWD || process.cwd();
process.env.CLI_ROOT = process.env.CLI_ROOT || path.resolve(__dirname, '..', '..');
return cli(options);
};