<script src="jquery.js"></script>
<script src="index.js"></script>
ℹ 「wds」: Project is running at https://localhost:8080/
Version: webpack 4.35.0
Time: 24334ms
...
+ 1388 hidden modules
ℹ 「wdm」: Compiled successfully.
What happened? Projects got bigger.
People do not like big files.
But isn't there a module system now? Jup.
Supported by all major browsers? Possibly.
But couldn't I just use these modules…
Heavily based on create-es-react-app by Luke Jackson,
featuring
es-react, csz and servor by Luke Jackson,
htm by Jason Miller
<script type="importmap">{"imports": {
"es-react": "./node_modules/es-react/index.js"
}}</script>
input: [
"Entry A",
"Entry B"
]
or
input: {
nameA: "Entry A",
nameB: "Entry B"
}
No added wrappers, there is a 1-to-1 equivalence
between
relevant bindings
You can bundle it again for the same output.
Modules are wrapped in functions in tables in each chunk.
Only the runtime knows how to load each module.
parse entry points from an HTML file and
replace with generated chunks
create chunks for workers
Today: Dynamic imports are regular entry points
Future: Take already loaded modules into account
Timeframe: Soon!
import {x} from './lib.js'console.log(x)
import {y} from './lib.js'console.log(y)
console.log('Hello')export const x = 1export const y = 2
import './chunk.js'const x = 1
console.log(x)
import './chunk.js'const y = 2
console.log(y)
console.log('Hello')
Timeframe: Remote future
Code: github.com/lukastaegert/isomorphic-code-splitting
Slides: lukastaegert.github.io/isomorphic-code-splitting