Skip to content

Commit 4dcf2fd

Browse files
committed
Add READMEs
1 parent 6536cd8 commit 4dcf2fd

File tree

7 files changed

+62
-0
lines changed

7 files changed

+62
-0
lines changed

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
This repository contains demos of using [unpkg.com](https://unpkg.com) to load and run various libraries in different ways. Each demo contains a README that explains a little bit more about how to use it and why it's interesting.
2+
3+
The following demos are currently available:
4+
5+
- [basic-react](basic-react) - Loads React as a global with JSX support
6+
- [systemjs-react-bundle](systemjs-react-bundle) - Uses SystemJS to load React as a global, with JSX support
7+
- [systemjs-react](systemjs-react) - Uses SystemJS to load React as modules, with JSX support
8+
- [systemjs-angular](systemjs-angular) - Uses SystemJS to load Angular as modules, with TypeScript support
9+
- [getlibs-react](getlibs-react) - Uses [getlibs](https://github.com/activewidgets/getlibs) as a convenience layer to easily load React as a global, with support for JSX
10+
- [webpack-react](webpack-react) - Uses webpack to automatically detect and load React as a global, with JSX compilation at build time
11+
12+
If you're using a technique you don't see listed here, please contribute! There are lots of different ways to use unpkg, and we're just scratching the surface.

basic-react/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This demo loads the global build of [React](https://facebook.github.io/react/) and [babel-standalone](https://github.com/babel/babel-standalone) from unpkg to get a development environment up and running quickly. Script compilation, including JSX, is done on the fly in the browser when scripts are contained in `<script type="text/babel">`.
2+
3+
To run it:
4+
5+
```
6+
$ npm install -g serve
7+
$ serve .
8+
```

getlibs-react/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This demo uses the [getlibs](https://github.com/activewidgets/getlibs) script to automatically load React as a global via [SystemJS](https://github.com/systemjs/systemjs). getlibs is interesting because it doesn't require any extra configuration; just a single `<script>` tag!
2+
3+
To run it:
4+
5+
```
6+
$ npm install -g serve
7+
$ serve .
8+
```

systemjs-angular/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This demo loads [Angular](https://angularjs.org/) as modules via [SystemJS](https://github.com/systemjs/systemjs). Script compilation (TypeScript) is done on the fly in the browser when scripts are loaded using `System.import`.
2+
3+
To run it:
4+
5+
```
6+
$ npm install -g serve
7+
$ serve .
8+
```

systemjs-react-bundle/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This demo loads the global build of [React](https://facebook.github.io/react/) and [babel-standalone](https://github.com/babel/babel-standalone) from unpkg via [SystemJS](https://github.com/systemjs/systemjs) to get a development environment up and running quickly. Script compilation, including JSX, is done on the fly in the browser when scripts are loaded using `System.import`.
2+
3+
To run it:
4+
5+
```
6+
$ npm install -g serve
7+
$ serve .
8+
```

systemjs-react/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This demo loads [React](https://facebook.github.io/react/) as modules via [SystemJS](https://github.com/systemjs/systemjs). Script compilation, including JSX, is done on the fly in the browser when scripts are loaded using `System.import`.
2+
3+
To run it:
4+
5+
```
6+
$ npm install -g serve
7+
$ serve .
8+
```

webpack-react/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This demo uses [webpack](https://webpack.github.io/) with the [modules-cdn-webpack-plugin](https://www.npmjs.com/package/modules-cdn-webpack-plugin) to load dependencies from unpkg.
2+
3+
The `modules-cdn-webpack-plugin` automatically detects dependencies and pulls their version numbers from the ones you've installed locally in `node_modules`. Then, it inserts the appropriate `<script>` tags in the output.
4+
5+
To run it:
6+
7+
```
8+
$ npm install
9+
$ npm start
10+
```

0 commit comments

Comments
 (0)