Skip to content

Commit

Permalink
🎨 Detect build chunks via dynamic imports in rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
mraerino committed May 31, 2018
1 parent b4fd999 commit 55bc10c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const plugins = [
].filter(plugin => plugin !== null);

const baseOptions = {
input: [src('index.ts'), src('views/view-party.ts'), src('views/view-tv.ts')],
input: src('index.ts'),
experimentalDynamicImport: true,
experimentalCodeSplitting: true,
plugins,
Expand All @@ -70,14 +70,14 @@ const baseOptions = {
export default [{
...baseOptions,
output: {
dir: dist('module'),
file: dist('module/index.js'),
format: 'es',
sourcemap: true,
},
}, {
...baseOptions,
output: {
dir: dist('nomodule'),
file: dist('nomodule/index.js'),
format: 'system',
sourcemap: true,
},
Expand Down
4 changes: 2 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1><span class="flash">⚡️</span> Oh, no! Unsupported Browser!</h1>
<script class="scripts" src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>

<!-- ES6 Module Code -->
<script src="/module/index.ts.js" type="module" class="scripts"></script>
<script src="/module/index.js" type="module" class="scripts"></script>

<!-- SystemJS Module Code -->
<script src="/node_modules/systemjs/dist/system-production.js"
Expand All @@ -83,7 +83,7 @@ <h1><span class="flash">⚡️</span> Oh, no! Unsupported Browser!</h1>
nomodule>
</script>
<script class="scripts" nomodule>
System.import('/nomodule/index.ts.js');
System.import('/nomodule/index.js');
</script>

<script>
Expand Down

0 comments on commit 55bc10c

Please sign in to comment.