DISCLAIMER: All characters appearing here are purely fictional. They just share the same first names of awesome CodingBlocks podcast hosts.
This is the story of JAM (Joe, Allen, and Michael), who are average developers and how they started using Webpack.
Keith, the Software Engineering Manager walks into the office one day to check the progress of the project started by JAM three days ago. He found Allen and Michael playing Call of Duty while Joe was working on his project by himself.
Let’s deploy a
create-react-app generated site on Netlify.
After signing in to Netlify, click on New Site from Git on the top right.
Click on GitHub button to choose a repository to deploy. It will prompt you for GitHub access.
You can give Netlify only a public repo access by clicking on the checkbox below “GitHub” button.
Filter by repo name and “pick a repository” by clicking on a repo returned.
Set the basic settings for
- Build command –
npm run build
- Publish directory –
After clicking on the “Deploy site” button, you will be forwarded to an “Overview” page with “Site deploy in progress” message.
After a few moments (<- this is relative term….), you will see a randomly generated URL.
OK, you just deployed a site on Netlify 🎉🎉🎉
*UPDATE* – October 28, 2018
Refer to the updated post, Loading React Components Dynamically on Demand using React.lazy if you are using
switch statement when displaying React components.
Then I ran into a dynamic import().
I will show you 3 ways to use
import() to dynamically load React Components.
- Loading React Components Dynamically – Demo – Source Code
- Handling Different Data Types – Demo – Source Code
- Loading Components on Demand – Demo – Source Code
Let’s dive in 🏊~