Previously, esperanto would always strip .js from module import paths, because these...
var foo = require( './foo' );
var foo = require( './foo.js' );
...are equivalent in CommonJS-land. (Does the ES6 module spec have an opinion about this? I couldn't find a reference.)
However that's not the case for external modules, which causes problems when creating bundles that import packages like highlight.js. This PR keeps the existing behaviour for relative module paths, but preserves the .js for external modules. Any opinions to the contrary before I merge it?
Previously, esperanto would always strip
.js
from module import paths, because these......are equivalent in CommonJS-land. (Does the ES6 module spec have an opinion about this? I couldn't find a reference.)
However that's not the case for external modules, which causes problems when creating bundles that import packages like highlight.js. This PR keeps the existing behaviour for relative module paths, but preserves the
.js
for external modules. Any opinions to the contrary before I merge it?