How to use the @embroider/compat.Addons function in @embroider/compat

To help you get started, we’ve selected a few @embroider/compat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github embroider-build / embroider / test-packages / support / build.ts View on Github external
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) {

@embroider/compat

Backward compatibility layer for the Embroider build system.

MIT
Latest version published 26 days ago

Package Health Score

81 / 100
Full package analysis

Similar packages