This is an example app for learning about how to use webpack
Fork or clone the repository then
npm install
You should be able to the app working by opening the index.html in your browser (it's pretty lo-fi)
-
Compile the JavaScript using webpack. Verify it works by running the included server.
- The required node modules should already be installed
- You will need to change
index.html
- A build script has been added to the
scripts
section ofpackage.json
- A
webpack.config.js
already exists for you to complete
-
The app looks bad. Improve by adding
style.css
to it.- Webpack can use 'loaders' to process different types of modules
- Use the
css-loader
andstyle-loader
-
Introduce an error into the app. I would suggest something like this:
const nextGreeting = GREETINGS[index + 1000];
Rebuild the app and make a note of the error trace in the console. Provide a better trace by using a sourcemap.- You could use either
devtool
orSourceMapDevToolPlugin
- You could use either
-
The app only has a production mode so development is pretty clunky. Create a live reloading development mode by using
webpack-dev-server
-
Convert the app to
react
. You will need to use thebabel-loader
to transpile the JSX.