|
1 | | -# React / TypeScript / JSPM / Hot-Reload - starter-kit |
| 1 | +# React / TypeScript / JSPM / Hot-Reload - starter-kit |
2 | 2 | > Modern & Minimalistic boilerplate for building modular apps with React - utilizing power of TypeScript, ES2016, Hot-Reload, async/await, ES Modules & in-browser transpiling powered by JSPM/SystemJS. |
3 | 3 |
|
4 | 4 | > Keeping up-to-date with new releases of React / TypeScript / JSPM, and to follow changes in the best practices as they might change with a new updates. |
|
14 | 14 | - COMPLETE-WORKFLOW - helpful npm scripts and tasks, github hooks, linter, test-harness etc. |
15 | 15 | - TDD-READY - test-harness setup with Tape (blue-tape) - included example code and @types |
16 | 16 | - EXTRAS - css only loader while waiting for React to "kick in" |
17 | | - |
| 17 | + |
18 | 18 | ##### Learn TypeScript from sample code |
19 | 19 | - Typescript definitions for third-party libraries |
20 | 20 | - solid tsconfig setup for ES2016 support |
@@ -47,53 +47,55 @@ My test procedure: |
47 | 47 |
|
48 | 48 | --- |
49 | 49 |
|
50 | | -## Usage |
| 50 | +## Installation |
51 | 51 |
|
52 | | -#### NPM Commands |
| 52 | +#### Prerequisites |
| 53 | +- Node.js and Git |
| 54 | +- Install JSPM with global flag to have jspm command available: `npm install jspm -g` (otherwise you'll have to use a local version from `~/node_modules/`) |
53 | 55 |
|
54 | | -`npm start` - start local dev server with hot-module-reload for JSPM [jspm-hmr](https://www.npmjs.com/package/jspm-hmr) |
55 | 56 |
|
56 | | -`npm run bundle-dev` - inject static dev-bundle to JSPM config for quick full-page reload |
| 57 | +#### 1. Clone repo |
| 58 | + git clone https://github.com/piotrwitek/react-ts-jspm-starter-kit.git my-project-folder |
57 | 59 |
|
58 | | -`npm run unbundle` - un-inject static dev-bundle from JSPM config |
| 60 | +#### 2. Install npm dependencies |
| 61 | + npm install |
59 | 62 |
|
60 | | -`npm run build` - build production app bundle (only your app source) - optimized minified version w/o source-maps (dist/ folder) |
| 63 | +#### 3. Run development server with HMR and enjoy best possible dev feedback-loop |
| 64 | + npm start |
61 | 65 |
|
62 | | -`npm run build-debug` - same as build but debug version with source-maps |
| 66 | +--- |
63 | 67 |
|
64 | | -`npm run build-deps` - build production dependency bundle (only external dependencies) (dist/ folder) |
| 68 | +## Usage |
65 | 69 |
|
66 | 70 | #### Dev Workflow |
67 | 71 | 1. `npm run bundle-dev` - _**OPTIONAL:** run only when your dependencies has changed_ |
68 | 72 | 2. `npm start` |
69 | 73 |
|
70 | | -#### Build for Production Workflow (WIP -> in next release) |
| 74 | +#### Build for Production Workflow |
71 | 75 | 1. `npm run build` |
72 | 76 | 2. `npm run build-deps` - _**OPTIONAL:** run only when your dependencies has changed_ |
73 | 77 | 3. open `http://localhost/dist/` to check |
74 | 78 | 4. deploy 'dist' contents on your server |
75 | 79 |
|
76 | | ---- |
| 80 | +#### Npm Commands |
77 | 81 |
|
78 | | -## Installation |
| 82 | +`npm start` - start local dev server with hot-module-reload for JSPM [jspm-hmr](https://www.npmjs.com/package/jspm-hmr) |
79 | 83 |
|
80 | | -#### Prerequisites |
81 | | -- Node.js and Git |
82 | | -- Install JSPM with global flag to have jspm command available: `npm install jspm -g` (otherwise you'll have to use a local version from `~/node_modules/`) |
| 84 | +##### Development Bundling |
83 | 85 |
|
| 86 | +`npm run bundle-dev` - bundle static dependencies for quick full-page reload, app sources remain as seperate modules for on-the-fly HMR & transpilation |
84 | 87 |
|
85 | | -#### 1. Create new project folder |
86 | | - mkdir my-project && cd my-project |
| 88 | +`npm run unbundle` - un-bundle static dependencies (usefull when changing app dependencies) |
87 | 89 |
|
88 | | -#### 2. Clone repo |
89 | | - git clone https://github.com/piotrwitek/react-ts-jspm-starter-kit.git . |
| 90 | +##### Production Bundling (`dist/` folder) |
90 | 91 |
|
91 | | -#### 3. Install npm dependencies |
92 | | - npm install |
| 92 | +`npm run build` - build app bundle (only your app source) - minified, no source-maps |
93 | 93 |
|
94 | | -#### 4. Run development server and start developing |
95 | | - npm start |
| 94 | +`npm run build-deps` - build dependency bundle (only external dependencies) - minified, no source-maps |
| 95 | + |
| 96 | +`npm run build-all` - build both app & dependecy bundle |
96 | 97 |
|
| 98 | +`npm run build-debug` - build app bundle - debug version with source-maps |
97 | 99 |
|
98 | 100 | --- |
99 | 101 |
|
|
0 commit comments