From 0cda33bd39731b38f8ea13825c10f8487de31c41 Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Thu, 7 Dec 2023 09:37:35 -0700 Subject: [PATCH] Fix description of v1/v2 add-ons The previous suggested change was supposed to include this, but missed it because of nested code blocks inside the suggested change. Whoops! --- README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 46da2cf45..49da79d84 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,9 @@ With every release, we output the `--typescript` output of new ember apps to thi ## How to use TypeScript without `ember-cli-typescript`? - Apps and v1 addons need to configure Babel to compile TypeScript files via the `ember-cli-babel` config, as described in the [ember-cli-babel](https://github.com/emberjs/ember-cli-babel#enabling-typescript-transpilation). -Additionally, you will need the `tsconfig.json` generated by the Ember TypeScript blueprint (see above), and then can run [`glint`](https://typed-ember.gitbook.io/glint) or `tsc` directly on the CLI. (Again, see the official docs for details!) +Additionally, you will need the `tsconfig.json` generated by the Ember TypeScript blueprint (see below for details), and then can run [`glint`](https://typed-ember.gitbook.io/glint) or `tsc` directly on the CLI. (Again, see the official docs for details!) ### Apps @@ -20,6 +19,24 @@ Additionally, you will need the `tsconfig.json` generated by the Ember TypeScrip 'ember-cli-babel': { enableTypeScriptTransform: true, }, +``` + +### v1 addons + +Configure this in the addon's `index.js` in the root of the project: + +```js +module.exports = { + name: require('package').name, + options: { + 'ember-cli-babel': { + enableTypeScriptTransform: true + } + } +} +``` + +### v2 addons The [V2 Addon Blueprint](https://github.com/embroider-build/addon-blueprint) does not use nor need ember-cli-typescript, nor any of its features.