Skip to content

Commit

Permalink
Update babel-plugin.js
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Aug 20, 2019
1 parent a8ccb4f commit 05dded4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions assets/babel-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ function getWebDependencyName(dep) {

function rewriteImport(imp, dir, shouldAddMissingExtension) {
const isSourceImport = imp.startsWith('/') || imp.startsWith('.')|| imp.startsWith('\\');
const isRemoteimport = imp.startsWith('http://') || imp.startsWith('https://');
dir = dir || 'web_modules';
if (!isSourceImport) {
if (!isSourceImport && !isRemoteimport) {
return path.posix.join('/', dir, `${getWebDependencyName(imp)}.js`);
}
if (shouldAddMissingExtension && !path.extname(imp)) {
if (!isRemoteimport && shouldAddMissingExtension && !path.extname(imp)) {
return imp + '.js';
}
return imp;
Expand Down

0 comments on commit 05dded4

Please sign in to comment.