You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Live-reload static resources like styles (CSS, SCSS), images, fonts or HTML templates through [SystemJS Plugins Ecosystem](https://github.com/systemjs/systemjs#plugins)
17
-
-Leveraging [SystemJS](https://github.com/systemjs/systemjs) for Universal Module Loading Support
11
+
-Fast Hot-Reload - using [systemjs-hot-reloader](https://github.com/capaj/systemjs-hot-reloader)
12
+
-Live-reload static files (e.g. styles (CSS/SCSS), images, fonts or HTML templates) through [SystemJS Plugins Ecosystem](https://github.com/systemjs/systemjs#plugins)
13
+
-Universal Module Loading with [SystemJS](https://github.com/systemjs/systemjs)
14
+
-Initialize minimal App with Babel or TypeScript transpilation workflow using CLI Wizard (including Hot-Reload configuration)
18
15
19
16
---
20
17
21
18
### Quick Start
22
-
Includes:
23
-
- Bootstrap Minimal App Boilerplate with fancy CLI Wizard
24
-
- Transpilation workflow setup to choose: Babel or TypeScript
19
+
- Bootstrap Minimal App Boilerplate guided by CLI Wizard
20
+
- Transpilation workflow setup: choose Babel or TypeScript
25
21
26
22
> __Tip:__ Confirm all Wizard Questions with Enter for default __Babel__ setup
27
23
28
-
##### _ONE-LINE-COMMAND_
24
+
##### _ONE-LINER_
29
25
```
30
26
npm i jspm@beta jspm-hmr -D && ./node_modules/.bin/jspm init && ./node_modules/.bin/jspm i systemjs-hot-reloader && ./node_modules/.bin/jspm-hmr -I && npm start
31
27
```
32
28
33
-
Now you can open `app.js` or `es6module.js` file, make some changes and save it to see __Hot-Reload__update running application without page refresh!
29
+
Now open `app.js` or `es6module.js` file from `src`, make some changes and save to see __Hot-Reload__updates in running application without page reload!
34
30
35
31
---
36
32
37
-
### Project setup
33
+
### Project prerequisite
38
34
39
35
-http://jspm.io - package manager and bundler for JS apps (webpack alternative)
40
36
`npm i jspm@beta -D`
@@ -49,7 +45,7 @@ Now you can open `app.js` or `es6module.js` file, make some changes and save it
49
45
$ npm i jspm-hmr -D
50
46
```
51
47
52
-
> __Tip:__ You can install it globally using -g flag so you can use it as simple http server in any directory on your machine
48
+
> __Tip:__ You can install this module globally using -g flag and use it as a simple static http server in any folder on your machine
53
49
54
50
> __Pro-Tip:__ You can use --init flag to initialize your project with index.html, app.js, server.js files - configured with hot-module-reload out-of-the-box
55
51
@@ -61,50 +57,55 @@ $ jspm-hmr [path] [options]
61
57
```
62
58
Options:
63
59
64
-
-h, --help output usage information
65
-
-V, --version output the version number
66
-
-i, --init CLI Wizard to bootstrap your project
67
-
-o, --open automatically open browser (default: false)
68
-
-p, --port <number> port number (default: 8888)
69
-
-c, --cache <seconds> enable Cache-Control with max-age=<seconds> (default: -1)
70
-
-P, --proxy <url> proxies requests to specified url
- Start dev server in PWD on port "4444" & automatically open in browser (last active window takes precedence)
79
+
- Start dev server in `pwd` on port "4444" & automatically open in browser (last active window takes precedence)
79
80
```
80
81
$ jspm-hmr . --port 4444 --open
81
82
```
82
83
83
-
- Start dev server in directory "dist" with caching set to "3600 sec" and proxy target set to "http://localhost:1234"
84
+
- Start dev server in directory "dist" with caching set to "3600 sec" and proxy target set to "http://localhost:1234" with proxy route pattern equal to `/api/`
- Start dev server in directory "dist" with https using built-in self-signed cert
89
90
```
90
91
$ jspm-hmr dist --ssl
91
92
```
92
93
94
+
- Start dev server in `pwd` with HTML5 History Api Fallback
95
+
```
96
+
$ jspm-hmr --fallback
97
+
```
98
+
93
99
---
94
100
95
101
### How it works
96
-
Watches specified files for changes in chosen path and emits events through web sockets on changes to your client to reload that particular JavaScript modules that has changed.
97
-
`-i` or `--init` flag will run CLI Wizard to bootstrap your `index.html`, `app.js` and `server.js` in your project folder with Dev Server and Hot-Reload configuration for quick start.
98
-
99
-
It uses great [systemjs-hot-reloader](https://github.com/capaj/systemjs-hot-reloader) for Client and [chokidar-socket-emitter](https://github.com/capaj/chokidar-socket-emitter) for Dev Server.
100
-
101
-
---
102
+
Chokidar process on dev server watches specified path for file changes and emits events through web socket to the browser web socket client to reload that particular JavaScript module that has been changed.
0 commit comments