Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static async build(project: Project, params: Partial) {
MacrosConfig.reset();
let paramsWithDefaults: BuildParams = Object.assign({}, params, defaultParams);
project.writeSync();
let instance;
if (paramsWithDefaults.type === 'addon') {
instance = emberAddon(project.baseDir, params.emberAppOptions);
} else {
instance = emberApp(project.baseDir, params.emberAppOptions);
}
let addons = new Addons(instance, params.embroiderOptions);
let tree;
if (params.stage === 1) {
tree = addons.tree;
} else {
let compatApp = new App(instance, addons, params.embroiderOptions);
tree = compatApp.tree;
}
let builder = new Builder(tree);
let builderPromise = builder.build();
let results = await Promise.all([builderPromise, addons.ready()]);
let basePath = results[1].outputPath;
return new BuildResult(project, basePath, builder);
}
private constructor(private project: Project, public outputPath: string, private builder: Builder) {