- Figure out the sequence
- a
index.html
with a lot of<script>
tags, figure out the right sequence to load all the scripts correctly.
- a
- Implement
define
- make all the scripts wrapped with
define
function and import dependencies byrequire
as the parameter ofdefine
. - implement
define
to load all the scripts correctly.
- make all the scripts wrapped with
- Asynchronize
require
- remove all the
<script>
tags and left only one forrequire.js
to setup the main entryapp.js
. - implement
define
inrequire.js
to import dependencies by adding<script>
tag asynchronously.
- remove all the
- Get together
- implement a Node.js program
webpack.js
to glue all the scripts together as one script file.
- implement a Node.js program
- Rip the wrapper
- remove all the invoking of
define
function but left callback body, and replace return statement with re-assigning value formodule.exports
. - implement
webpack.js
to load all the wrapper-ripped scripts correctly.
- remove all the invoking of
- Configurable
-
Notifications
You must be signed in to change notification settings - Fork 0
KataWorks/web-modularization
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published