Switch branches/tags
Find file History
Pull request Compare This branch is 6 commits ahead, 266 commits behind canary.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
components
pages Update with-dynamic-import example (#5201) Sep 23, 2018
README.md #4751 - Explicitly mention install when cloning examples (#4758) Jul 11, 2018
next.config.js Update with-dynamic-import example (#5201) Sep 23, 2018
package.json Update Next.js version on examples Jan 30, 2018

README.md

Example app with dynamic-imports

How to use

Using create-next-app

Execute create-next-app with Yarn or npx to bootstrap the example:

npx create-next-app --example with-dynamic-import with-dynamic-import-app
# or
yarn create next-app --example with-dynamic-import with-dynamic-import-app

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-dynamic-import
cd with-dynamic-import

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Deploy it to the cloud with now (download)

now

The idea behind the example

This examples shows how to dynamically import modules via import() API