Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

Commit

Permalink
feat(webcomponents-loader): re-added with correct logic
Browse files Browse the repository at this point in the history
  • Loading branch information
LasaleFamine committed Nov 28, 2017
1 parent 81f2586 commit e37f75a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@
} else {
console.log('Service worker is not supported');
}

document.addEventListener('WebComponentsReady', function componentsReady() {
document.removeEventListener('WebComponentsReady', componentsReady, false);

var script = document.createElement('script');
script.async = true
script.src = './bundle.js';
script.setAttribute('nomodule', true);

var scriptModule = document.createElement('script');
scriptModule.async = true
scriptModule.src = './module.bundle.js';
scriptModule.setAttribute('module', true);


var refScript = document.body.getElementsByTagName('script')[0];
refScript.parentNode.insertBefore(script, refScript);
}, false);
</script>
</head>

Expand Down
4 changes: 4 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ const copyStatics = {
from: resolve('./node_modules/@webcomponents/webcomponentsjs/webcomponents-sd-ce.js'),
to: join(outputPath, 'vendor'),
flatten: true
}, {
from: resolve('./node_modules/@webcomponents/webcomponentsjs/webcomponents-hi-sd-ce.js'),
to: join(outputPath, 'vendor'),
flatten: true
}, {
from: resolve('./node_modules/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'),
to: join(outputPath, 'vendor'),
Expand Down

0 comments on commit e37f75a

Please sign in to comment.