mohkale / jekyll-tsc

compile typescript files on your jekyll blog
MIT License
9 stars 2 forks source link

Source-map copying doesn't happen #3

Open agatha2 opened 3 years ago

agatha2 commented 3 years ago

Specifying "sourceMap": true in "tsconfig.json" correctly outputs a "<foo>.js.map" file into ".typescript/". However, this file is not copied to the destination, and the browser will complain that the map is missing.

Note that adding copy_ext: [ ".map" ] to "_config.yaml" doesn't (and shouldn't) work (shouldn't, because if the map is generated, it should probably be copied unconditionally, and whether the map is generated in the first place is already configured by "tsconfig.json").

(Though great project; does what I want mostly; thanks!)

mohkale commented 3 years ago

See my comment in #2. If you'd like to send a PR to support copying over .map files I'd be happy to review and merge it in.

Admittedly I don't like how ad-hoc this plugin is. It assumes the only thing that will be generated will be js files from typescript files. As for configuration because the typescript compiler doesn't let you specify an output directory and also pass a tsconfig.json file, I've basically had to convert tsconfig.json into command line flags to pass to the compiler process. I blame the compiler for valuing configuration over scriptability but it doesn't really matter I suppose.