Skip to content

Commit 6695f61

Browse files
authored
Merge pull request #137 from typed-ember/update-main-generator-for-sourcemaps
Update addon generator to support sourcemaps. 13:46:39
2 parents b8c09b3 + b9945b4 commit 6695f61

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Use TypeScript in your Ember 2.x and 3.x apps!
77
* [Setup and Configuration](#setup-and-configuration)
88
* [Ember Support](#ember-support)
99
* [`tsconfig.json`](#tsconfigjson)
10+
* [Sourcemaps](#sourcemaps)
1011
* [Using TypeScript with Ember effectively](#using-typescript-with-ember-effectively)
1112
* [Incremental adoption](#incremental-adoption)
1213
* [Install other types!](#install-other-types)
@@ -84,6 +85,20 @@ However, there are a few things worth noting if you're already familiar with Typ
8485
[blueprint]: https://github.com/typed-ember/ember-cli-typescript/blob/master/blueprints/ember-cli-typescript/files/tsconfig.json
8586
[broccoli]: http://broccolijs.com/
8687

88+
### Sourcemaps
89+
90+
To enable TypeScript sourcemaps, you'll need to add the corresponding configuration for Babel to your `ember-cli-build.js` file:
91+
92+
```ts
93+
const app = new EmberApp(defaults, {
94+
babel: {
95+
sourceMaps: 'inline',
96+
},
97+
});
98+
```
99+
100+
(Note that this _will_ noticeably slow down your app rebuilds.)
101+
87102
## Using TypeScript with Ember effectively
88103

89104
In addition to the points made below, you may find the [Typing Your Ember][typing-your-ember] blog series (especially the "Update" sequence) particularly helpful in knowing how to do specific things.

blueprints/ember-cli-typescript/files/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"noImplicitThis": true,
88
"noEmitOnError": false,
99
"noEmit": true,
10-
"sourceMap": true,
10+
"inlineSourceMap": true,
11+
"inlineSources": true,
1112
"baseUrl": ".",
1213
"module": "es6",
1314
"paths": <%= pathsFor(dasherizedPackageName) %>

node-tests/blueprints/ember-cli-typescript-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ describe('Acceptance: ember-cli-typescript generator', function() {
3737
'*': ['types/*'],
3838
});
3939

40+
expect(tsconfigJson.compilerOptions.inlineSourceMap).to.equal(true);
41+
expect(tsconfigJson.compilerOptions.inlineSources).to.equal(true);
42+
4043
expect(tsconfigJson.include).to.deep.equal(['app', 'tests']);
4144

4245
const projectTypes = file('types/my-app/index.d.ts');

0 commit comments

Comments
 (0)