-
Notifications
You must be signed in to change notification settings - Fork 32
Description
The es6!
plugin can't load lit-html
due to problems with relative paths and file extensions. To reproduce, do an
npm install lit-html
add the entry below to paths
in index.html:
'lit-html': '../node_modules/lit-html/lit-html',
and then modify demo/class.js to load lit-html
:
import {html, render} from 'lit-html';
It fails trying to GET:
requirejs-babel/demo/lib/default-template-processor.js.js
There are (at least) two problems here:
(1) The es6.js
code appends fileExtension
even for import
statements that already have a file extension. lit-html.js
has imports like below that specify the .js
extension:
import { defaultTemplateProcessor } from './lib/default-template-processor.js';
As per the examples in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import, putting the .js
in the import
statement is actually not an error.
(2) Relative paths aren't working correctly. The ./
in the import
statement above should be relative to the directory where lit-html.js
is. Instead, it's evaluating relative to the directory where class.js
is.