1 | Object.defineProperty(exports, "__esModule", { value: true });
|
2 | var config_1 = require("./webpack/config");
|
3 | var static_1 = require("../../static");
|
4 | var compiler_1 = require("./ngc/compiler");
|
5 | var compiler_2 = require("./webpack/compiler");
|
6 | exports.getCompilerFromProject = function (project) {
|
7 | var hasFile = function (filename) { return project.basePath.findImmediateChild(filename) != null; };
|
8 | if (static_1.Files.webpack.some(function (f) { return hasFile(f); })) {
|
9 | return new compiler_2.WebpackCompiler(project, new config_1.WebpackLoader());
|
10 | }
|
11 | else if (static_1.Files.cli.some(function (f) { return hasFile(f); })) {
|
12 | return new compiler_2.WebpackCompiler(project, new config_1.CliLoader());
|
13 | }
|
14 | else {
|
15 | return new compiler_1.NgcCompiler(project);
|
16 | }
|
17 | };
|
18 |
|
\ | No newline at end of file |