Fix for extension problem (es6 trying to load foo.js.js) and relative path problem. #35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here are some proposed changes for
es6.js
to be able to load lit-html (and other problematic modules). The rest of the changed files are just for testing and don't necessarily need to be checked in.The problem I saw was with loading lit-html.js via an absolute path, and then lit-html.js tried to load files relative to itself via relative paths like "./lib/default-template-processor.js".
The first issue is that es6 appends ".js" even though the path already has an extension. So that's a trivial one-line fix.
The second problem is to fix relative paths. es6 was interpreting the relative path above to be relative to the original module, or something like that. I updated resolvePath() so it interprets it relative to the file doing the import.
I tested on chrome and IE11. Didn't try a build though, since we aren't using r.js for builds anymore.
Fixes #34.