empress / ember-cli-showdown

Ember component to render markdown into HTML.
https://empress.github.io/ember-cli-showdown/
MIT License
101 stars 35 forks source link

Remove sourceMappingURL for showdown #60

Closed Dhaulagiri closed 6 years ago

Dhaulagiri commented 7 years ago

Trying to build our app that uses ember-cli-showdown with ember-cli-uglify@2.0.0 results in this error:

Error: ENOENT: no such file or directory, open '/tmp/build_6cc7dc214277453a580cd882a48b6d24/fb52bf4fa3db7ca893b6657aff4733087b2878fb/tmp/uglify_writer-input_base_path-mvvjRQhP.tmp/assets/showdown.js.map'

Similar issues have been reported upstream in ember-cli-uglify but it seems as though what is happening here is actually exposing an existing issue. I was able to fix this by following a similar solution as was done here to fix a similar problem in Ember itself.

jasonmit commented 7 years ago

Could this issue be solved by writing the sourcemap to the public tree (assets)?

Dhaulagiri commented 7 years ago

@jasonmit I believe that would also do it, but I wasn't quite sure how to do that here. Any tips?

jasonmit commented 7 years ago

@Dhaulagiri treeForPublic would be the place where you would funnel in the map file similar to https://github.com/gcollazo/ember-cli-showdown/blob/master/index.js#L43-L45

jasonmit commented 6 years ago

@Dhaulagiri I think we have a chance to work on this together, lets revisit soon :)

jasonmit commented 6 years ago

@Dhaulagiri can you restore your branch and I'll reopen and merge. The real fix of respecting the showdown sourcemap will be quite difficult because when it does find the sourcemap for showdown.js.map it ends up replaces the contents of vendor.map with showdown.js.map instead of concatting.

I'd prefer to land you fix while I investigate why that is happening.

Dhaulagiri commented 6 years ago

Done

jasonmit commented 6 years ago

Versioned as 4.1.1 - thanks again. I'll continue investigating the underlying issue upstream.

Dhaulagiri commented 6 years ago

@jasonmit thanks! and let me know if you need any help.