computmaxer / karma-jspm

Other
74 stars 50 forks source link

Only set SystemJS baseURL once #111

Closed hmps closed 8 years ago

hmps commented 8 years ago

This is a proposed fix for #106.

Using some setups karma-jspm will try to set SystemJS.baseURL a second time.

maxwellpeterson-wf commented 8 years ago

Does this work if your new if condition fails (i.e. System.baseURL is truthy), and System.config({ baseURL: 'base' }); never gets called? Seems like unless you include base in your baseURL elsewhere it wouldn't, because Karma serves files out of /base/.

hmps commented 8 years ago

Hi @maxwellclarke-wf! The issue I was seeing, together with several others in my team and in issue #106, is that since SystemJS 0.19.4 the System.baseURL already was set at the time when adapter.js was executed.

In my setup I have only seen System.baseURL being truthy when it is actually set.

I'm sure you have better insight into the matter. Can you see any point where this would / could fail? If so, another solution might be necessary.

hmps commented 8 years ago

See my comment in #106 @maxwellclarke-wf. It seems like the problem was solved by SystemJS 0.19.6.

I'll abandon this PR.

Thank you for your great work on this!