You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
minify() with enclose option appears to break source map #1333
This gets weirder and weirder. I think this might be an incompatibility between Terser's decoded_map and Rollup. minify() does indeed produce a source map for my test case, but Rollup does not seem to like it.
Interestingly, your code snippet triggers the same problem when I place it in my source file.
One thing I noticed is that our test cases share a map sources of [null, '0']. I haven't pinpointed the code yet, but I think the null source is resulting in an off by one error inside Rollup. Changing the source code input can result in a sources of ['0'], and when this happens Rollup emits a source map with content.
Activity
fabiosantoscode commentedon Jan 19, 2023
I can't reproduce with this call:
dqh-au commentedon Jan 20, 2023
This gets weirder and weirder. I think this might be an incompatibility between Terser's decoded_map and Rollup. minify() does indeed produce a source map for my test case, but Rollup does not seem to like it.
Interestingly, your code snippet triggers the same problem when I place it in my source file.
One thing I noticed is that our test cases share a map
sourcesof[null, '0']. I haven't pinpointed the code yet, but I think the null source is resulting in an off by one error inside Rollup. Changing the source code input can result in asourcesof['0'], and when this happens Rollup emits a source map with content.Is a null source valid? I am new to this, but It does seem odd that a single source is producing two sources in the source map. I'm not sure what the right spec is, but https://sourcemaps.info/spec.html doesn't say anything about a null source.
Another thing I noticed while testing is that the enclose option doesn't always result in wrapping the output in an life. For example:
outputs:
Whereas if I change the source to
'const log = console.log.bind(console); const warn = console.warn.bind(console); log("")', the output is: