How to use the @embroider/macros.isEmbroiderMacrosPlugin function in @embroider/macros

To help you get started, we’ve selected a few @embroider/macros 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 / packages / compat / src / v1-addon.ts View on Github external
function babelPluginAllowedInStage1(plugin: PluginItem) {
  if (isEmbroiderMacrosPlugin(plugin)) {
    // the point of @embroider/macros is that it's allowed to stay in v2
    // addon publication format, so it doesn't need to run here in stage1.
    // We always run it in stage3.
    return false;
  }

  if (TemplateCompiler.isInlinePrecompilePlugin(plugin)) {
    // Similarly, the inline precompile plugin must not run in stage1. We
    // want all templates uncompiled. Instead, we will be adding our own
    // plugin that only runs custom AST transforms inside inline
    // templates.
    return false;
  }

  return true;
}
github embroider-build / embroider / packages / compat / src / v1-app.ts View on Github external
plugins = plugins.filter(p => {
      // even if the app was using @embroider/macros, we drop it from the config
      // here in favor of our globally-configured one.
      return (
        !isEmbroiderMacrosPlugin(p) &&
        // similarly, if the app was already using an inline template compiler
        // babel plugin, we remove it here because we have our own
        // always-installed version of that (v2 addons are allowed to assume it
        // will be present in the final app build, the app doesn't get to turn
        // that off or configure it.)
        !TemplateCompiler.isInlinePrecompilePlugin(p)
      );
    });
github embroider-build / embroider / packages / compat / src / v1-app.ts View on Github external
      options.plugins.ast = options.plugins.ast.filter((p: any) => !isEmbroiderMacrosPlugin(p));
    }
github embroider-build / embroider / packages / compat / src / v1-addon.ts View on Github external
        options.plugins.ast = options.plugins.ast.filter((p: any) => !isEmbroiderMacrosPlugin(p));
        if (options.plugins.ast.length > 0) {

@embroider/macros

Standardized build-time macros for ember apps.

MIT
Latest version published 3 days ago

Package Health Score

83 / 100
Full package analysis