Part 2 of a 3 part series where we test and assert general knowledge in understanding and setting up Webpack. Please read this entire document to best decide which approach you'd like to take.
Please see Part 1 before moving on the this section.
The aim of this section is to assert the knowledge of the NPM package webpack. As such, this repo is project based and will simply present requirements to get setup with bundling.
Successful completion of this knowledge-check means satisfying the following requirements:
- Converting an existing project to take advantage of webpack bundling.
- Generating a
webpack.config.js
to ease development. - Creating proper scripts in your
package.json
to respond to relevantstart
/build
situations. - Submitting a proper PR that adheres to our discussed PR process.
The webpack.config.js
should be able to accomodate the following:
- Initiate babel to perform transpilation of
es2015
,es2016
,es2016+
, andreact
- Serve files using a dev elopment server
- A simple
source-map
for easy development debugging - The ability to import
CSS
andImages
- Enable Hot Reloading as a fallback to the development server
- Configure
HTMLWebpack Plugin
to automatically generate an.html
in/dist
. This generated file should have a differenttitle
.
Additionally, package.json
should contain relevant scripts
to accomodate the following:
- build webpack to generate a 1 time, production-ready bundle
- watch files and generate a new bundle every save
- open a new tab when in watch mode
This project, as with many others, is kept intentionally vague of where to look. All information can be found the the official docs. However, since this project is meant to be completed independently, googling solutions, looking at previous code, etc is allowed--be prepared for the rabbit hole this may lead to. You're expected to get stuck, especially since there are many ways to configure your bundle--hang in there and push through.
This project contains sample code to work with so that time isn't spent deciding what to test your work against. However, if feeling ambitious, special notes will be made for those that can successfully refactor the multiple-gifs project to take advantage of your webpack
seed and react.