mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add weback-dev-server with hot/hmr support
* adds `npm start` / `yarn start` script * starts a webpack-dev-server using the dev config, served on :3333 * hot reloading (HMR) for react/styles, not working for angular code * new entry `dev.ts` for dynamic imports of CSS theme (ExtractText does not work with HMR) * TS loader pipeline moved out of common to add HMR for react * applied `hot()` to some react containers (that's their new default export, named exports remains for testing) * added sections to README * updated yarn.lock
This commit is contained in:
11
README.md
11
README.md
@@ -39,12 +39,21 @@ go run build.go build
|
||||
|
||||
For this you need nodejs (v.6+).
|
||||
|
||||
To build the assets, rebuild on file change, and serve them by Grafana's webserver (http://localhost:3000):
|
||||
```bash
|
||||
npm install -g yarn
|
||||
yarn install --pure-lockfile
|
||||
npm run watch
|
||||
```
|
||||
|
||||
Build the assets, rebuild on file change with Hot Module Replacement (HMR), and serve them by webpack-dev-server (http://localhost:3333):
|
||||
```bash
|
||||
yarn start
|
||||
# OR set a theme
|
||||
env GRAFANA_THEME=light yarn start
|
||||
```
|
||||
Note: HMR for Angular is not supported. If you edit files in the Angular part of the app, the whole page will reload.
|
||||
|
||||
Run tests
|
||||
```bash
|
||||
npm run jest
|
||||
@@ -55,6 +64,8 @@ Run karma tests
|
||||
npm run karma
|
||||
```
|
||||
|
||||
Run
|
||||
|
||||
### Recompile backend on source change
|
||||
|
||||
To rebuild on source change.
|
||||
|
||||
Reference in New Issue
Block a user