when tsconfig specifies `inlineSourceMap: true` then no sourcemap is generated
See original GitHub issueWhat happens and why it is wrong
in my tsconfig.json I have inlineSourceMap: true
. I also configured rollup to use sourcemap: 'inline'
. Rollup builds occur without issue, but my resultant .js file contained an inline sourcemap for non-ts assets only. After much experimentation I found that I can re-enable sourceMaps for TS with the following configuration:
typescript({
tsconfigOverride: {
compilerOptions: {
sourceMap: true,
inlineSourceMap: false,
This is not intuitive. I’ve already expressed that I want sourcemaps, and that I want rollup to generate an inline sourcemap. The plugin should ideally respect the inlineSourceMap
option in tsconfig.json
.
If this is not feasible [likely because it’s hard to scrape out inline source maps from tsc output] then there should be an error displayed and rollup should fail, telling the user they must disable inlineSourceMap
and enable sourceMap
in their typescript overrides.
Environment
Not relevant
Versions
- typescript: 2.7.2
- rollup: 0.57.1
- rollup-plugin-typescript2: 0.12.0
rollup.config.js
I’m only including the relevant portion.
Original:
typescript({
tsconfigOverride: {
compilerOptions: {
module: "ES2015"
}
}
}),
With Workaround:
typescript({
tsconfigOverride: {
compilerOptions: {
sourceMap: true,
inlineSourceMap: false,
module: "ES2015"
}
}
}),
tsconfig.json
{
"compilerOptions": {
// ...
"inlineSourceMap": true,
// ...
},
// ...
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top GitHub Comments
My use case is developer mode with rollup:
format: 'es'
andpreserveModules: false
<script type="module"
to load modules from page.With
inlineSourceMaps: true
I can get my typescript source also in this dev mode, but the force setting tofalse
means I need to use the OP override.@ezolenko care to elaborate why forcing
inlineSourceMap
tofalse
would be wanted behavior?inlineSourceMap
looks like another candidate for being forcefully overridden tofalse
. I don’t think there is a valid case where it being set to true would do anything useful.