Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 0c13581

Browse files
committed
Merge pull request #8 from rollup/fix-source-maps
Enable source maps per default, parse source map string
2 parents bac0c7f + 83b4b4b commit 0c13581

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export default {
2222
entry: 'main.ts',
2323

2424
plugins: [
25-
typescript({
26-
sourceMap: true
27-
})
25+
typescript()
2826
]
2927
}
3028
```
@@ -46,7 +44,6 @@ export default {
4644
plugins: [
4745
typescript({
4846
target: ts.ScriptTarget.ES6
49-
sourceMap: true
5047
})
5148
]
5249
}

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ module.exports = function ( options ) {
2323
var transformed = typescript.transpileModule( code, {
2424
compilerOptions: assign( {
2525
target: typescript.ScriptTarget.ES5,
26-
module: typescript.ModuleKind.ES6
26+
module: typescript.ModuleKind.ES6,
27+
sourceMap: true
2728
}, options )
2829
});
2930

3031

3132
return {
3233
code: transformed.outputText,
33-
map: transformed.sourceMapText
34+
// Rollup expects `map` to be an object so we must parse the string
35+
map: JSON.parse(transformed.sourceMapText)
3436
};
3537
}
3638
};

0 commit comments

Comments
 (0)