forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): re-add support for sourceDir (angular#1378)
- Loading branch information
1 parent
83c86c2
commit 89f521e
Showing
3 changed files
with
7 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +0,0 @@ | ||
import * as Promise from 'ember-cli/lib/ext/promise'; | ||
import * as Task from 'ember-cli/lib/models/task'; | ||
import * as path from 'path'; | ||
import { getWebpackTestConfig } from '../models/webpack-build-test'; | ||
|
||
// require dependencies within the target project | ||
function requireDependency(root, moduleName) { | ||
const packageJson = require(path.join(root, 'node_modules', moduleName, 'package.json')); | ||
const main = path.normalize(packageJson.main); | ||
return require(path.join(root, 'node_modules', moduleName, main)); | ||
} | ||
|
||
module.exports = Task.extend({ | ||
run: function (options) { | ||
const projectRoot = this.project.root; | ||
return new Promise((resolve) => { | ||
const karma = requireDependency(projectRoot, 'karma'); | ||
const karmaConfig = path.join(projectRoot, this.project.ngConfig.test.karma.config); | ||
|
||
// Convert browsers from a string to an array | ||
if (options.browsers) { | ||
options.browsers = options.browsers.split(','); | ||
} | ||
|
||
// Assign additional karmaConfig options to the local ngapp config | ||
options.configFile = karmaConfig; | ||
|
||
// :shipit: | ||
const karmaServer = new karma.Server(options, resolve); | ||
karmaServer.start(); | ||
}); | ||
} | ||
}); | ||