Skip to content

rollup_bundle loses sourcemap context due to running tsc for downleveling #175

Closed
@mhevery

Description

@mhevery

Here is my understand of how rollup_bundle works:

  1. copy files into bundles.es6 directory
  2. Rollup the files in bundles.es6 directory into bundle.es6.js file
  3. Downlevel the file from ES6 -> ES5 into bundle.js using tsc
  4. Run uglify to generate bundle.min.js

The pipeline above works fine for the source code, but it brakes source map. There are 2 issues:

  1. Many of the actions do not declare *.js.map as output of the action. This can be easily fixed as shown here
  2. The source map pipeline is broken. The reason for this is that when tsc is used to downlevel the code from ES2015->ES5 tsc assumes that bundle.es6.js is the source file. This is incorrect assumption. Instead tsc should transform the source maps in bundel.es6.js to the next step. I am not even sure if tsc supports such mode. In any case the issue is that at this point the source map have been destroyed and so the subsequent source maps are of no value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions