https://github.com/engineerapart/nextscript-example
An example usage of the nextscript component
https://github.com/engineerapart/nextscript-example
Last synced: 8 months ago
JSON representation
An example usage of the nextscript component
- Host: GitHub
- URL: https://github.com/engineerapart/nextscript-example
- Owner: engineerapart
- Created: 2018-07-21T06:49:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-21T07:02:04.000Z (almost 8 years ago)
- Last Synced: 2024-12-27T09:12:57.876Z (over 1 year ago)
- Language: JavaScript
- Size: 40 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/hello-world)
# Custom NextScript example
## How to use
### Download manually
Download the example [or clone the repo](https://github.com/engineerapart/nextscript-example):
```bash
git clone https://github.com/engineerapart/nextscript-example
cd nextscript-example
```
Install it and run:
```bash
npm install
npm run dev
# or
yarn
yarn dev
```
Deploy it to the cloud with [now](https://zeit.co/now) ([download](https://zeit.co/download))
```bash
now
```
You can then load up the example in an older browser via Browserstack or other browser testing platform.
## The idea behind the example
This example shows you how to use the custom NextScript component to control the loading of your Next script resources, including waiting for polyfills to resolve.
Once deployed, you can load this example in an older browser, for example IE11, and you will see that the functions used in `pages/index.js` do not throw exceptions IE, demonstrating that they have been polyfilled.
Also, open up your browser's dev tools and check out the `__next_preloader` script node - there you will see the preloader script, with settings you have configured being applied to the generated script.