Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Support of source-maps #26

Open
Qvatra opened this issue Jan 21, 2016 · 2 comments
Open

Support of source-maps #26

Qvatra opened this issue Jan 21, 2016 · 2 comments

Comments

@Qvatra
Copy link

Qvatra commented Jan 21, 2016

Is there are any possibility to have error tracking in Polymer?

related issue in stackoverflow: http://stackoverflow.com/questions/34921477/how-to-implement-error-tracking-in-a-polymer

related in Vulcanaze: https://github.com/Polymer/vulcanize/issues/12

@Qvatra
Copy link
Author

Qvatra commented Jan 21, 2016

my idea is:

according to https://github.com/PolymerLabs/polybuild polybuild tool is the same as:

vulcanize --inline-css --inline-scripts --strip-comments index.html | polyclean | crisper --html index.build.html --js index.build.js

the order is:

  1. vulcanize produces one html formatted file.
  2. polyclean uses uglifyjs internaly and perform some cleaning
  3. crisper is used to separate already uglyfied and minified js from html

as far as I know uglifyjs doesn't work with html files as input so polyclean manually cuts parts of js code', put it through uglifyjs and paste it back (I hope I understood correctly how polyclean works). That's why creating of source maps is useless in this context.

my idea is to change the order of polyclean and crisper and modify polyclean to allow using external options for uglifyjs2:
new order:

  1. vulcanize produces one html formatted file.
  2. crisper is used to separate formatted js from html.
  3. polyclean uses uglifyjs internaly and perform some cleaning (in this case we need to use on both js and html files)

So first you will have html file and formatted js file and only then you can use uglifyjs2(call from polyclean or standalone?) with --source-map and --source-map-include-sources options.
Now you can keep tracking your errors using produced source-map which already contains formatted copy of js file produced in step 2.

@maxiplay
Copy link

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants