# @glimmer/app-compiler

> Broccoli tooling for Glimmer-VM based applications

Latest version **1.1.2** (published 2022-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @glimmer/app-compiler
pnpm add @glimmer/app-compiler
yarn add @glimmer/app-compiler
bun add @glimmer/app-compiler
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-04-11 |
| First published | 2017-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 8 |
| Unpacked size | 65.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 751 |
| Maintainers | tomdale, rwjblue, dgeb, locks, chancancode, wycats, chadhietala, krisselden, stefanpenner, mmun, mixonic, pzuraq |

## Links

- npm: https://www.npmjs.com/package/@glimmer/app-compiler
- Repository: https://github.com/glimmerjs/glimmer.js
- Homepage: https://github.com/glimmerjs/glimmer.js#readme
- Issues: https://github.com/glimmerjs/glimmer.js/issues
- npm.io page: https://npm.io/package/@glimmer/app-compiler

## Dependencies (8)

- [debug](https://npm.io/package/debug.md) ^3.1.0
- [walk-sync](https://npm.io/package/walk-sync.md) ^0.3.2
- [broccoli-plugin](https://npm.io/package/broccoli-plugin.md) ^1.3.0
- [@glimmer/interfaces](https://npm.io/package/@glimmer/interfaces.md) ^0.44.0
- [@glimmer/application](https://npm.io/package/@glimmer/application.md) ^1.1.2
- [@glimmer/bundle-compiler](https://npm.io/package/@glimmer/bundle-compiler.md) ^0.44.0
- [@glimmer/opcode-compiler](https://npm.io/package/@glimmer/opcode-compiler.md) ^0.44.0
- [@glimmer/compiler-delegates](https://npm.io/package/@glimmer/compiler-delegates.md) ^1.1.2

## Recent versions

- 1.1.2 (latest) — 2022-04-11
- 1.0.0-beta.3 (next) — 2019-11-19
- 1.1.1 — 2022-04-01
- 1.1.0 — 2022-03-31
- 1.0.4 — 2021-02-26
- 1.0.3 — 2020-12-10
- 1.0.2 — 2020-09-18
- 1.0.1 — 2020-07-27
- 1.0.0 — 2019-12-11
- 1.0.0-beta.2 — 2019-11-15
- 1.0.0-beta.1 — 2019-10-23
- 0.14.0-alpha.13 — 2019-08-22
- 0.14.0-alpha.12 — 2019-08-16
- 0.14.0-alpha.11 — 2019-08-10
- 0.14.0-alpha.10 — 2019-08-08
- … 30 more at https://npm.io/package/@glimmer/app-compiler/versions

## README

# @glimmer/app-compiler

A broccoli plugin that wraps Glimmer's optimizing compiler for producing the required pre-computed objects for Glimmer VM based applications.

## Basic Usage

For most apps the plugin can be used as the following:

```ts
import { BundleCompiler } from '@glimmer/app-compiler';
...

let optimizedApp = BundleCompiler(app, {
  projectPath: 'my-app',
  mode: 'module-unification'
});

return optimizedApp;
```

## Advanced Usage

If you need to do more advanced things like registering AST plugins or using custom project layout you can do something like the following:

```ts
import { BundleCompiler } from '@glimmer/app-compiler';
import { BundleCompilerDelegate } from '@glimmer/compiler-delegates'
...

class MyCustomCompilerDelegate implements BundleCompilerDelegate {
  ...
}

let optimizedApp = BundleCompiler(app, {
  projectPath: 'my-app',
  delegate: MyCustomCompilerDelegate,
  outputFiles: {
    heapFile: 'snowflake/location/template.gbx',
    dataSegment: 'snowflake/data.js'
  },
  bundleCompiler: {
    plugins: [MyASTPlugin]
  }
});

return optimizedApp;
```

### Options

```ts
interface GlimmerBundleCompilerOptions {
  projectPath: string;                      // where the project is at
  bundleCompiler: BundleCompilerOptions;    // Options specifically for the compiler
  outputFiles?: OutputFiles;                // Where to write the output
  delegate?: BundleCompilerDelegateConstructor; // Delegate to discover information about templates
  mode?: 'module-unification';              // Builtin delegate
}

interface BundleCompilerDelegateConstructor {
  new(): BundleCompilerDelegate;
}

export interface OutputFiles {
  dataSegment: Option<string>;
  heapFile: Option<string>;
}

interface BundleCompilerOptions {
  plugins?: ASTPluginBuilder[];
}
```

---
_Source: https://npm.io/package/@glimmer/app-compiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
