Skip to content

Commit 7d94949

Browse files
committed
Updates to support local UI dev
1 parent 2ab610e commit 7d94949

File tree

4 files changed

+1047
-26
lines changed

4 files changed

+1047
-26
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"scripts": {
99
"type-check": "tsc -p tsconfig.json --noEmit",
1010
"build": "NODE_ENV=production webpack --progress --config scripts/webpack/webpack.prod.js",
11+
"dev": "webpack serve --config scripts/webpack/webpack.dev.js",
1112
"backend:dev": "make build run 'PARAMS=--config.file ./cmd/pyroscope/pyroscope.yaml'",
1213
"lint": "eslint . --ext .js,.tsx,.ts --cache",
1314
"lint:fix": "yarn lint --fix",
@@ -79,6 +80,7 @@
7980
"web-streams-polyfill": "^3.2.1",
8081
"webpack": "^5.94.0",
8182
"webpack-cli": "^5.0.1",
83+
"webpack-dev-server": "^5.2.2",
8284
"webpack-merge": "^5.8.0"
8385
},
8486
"dependencies": {

public/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
```bash
66
yarn install
7-
# Make sure you have the backend running.
7+
# Make sure you have the backend running after building with EMBEDASSETS="".
8+
# Note the frontend is accessible via localhost:4041.
89
yarn dev
910
```
1011

scripts/webpack/webpack.dev.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@ module.exports = merge(common, {
1010
devServer: {
1111
port: 4041,
1212
historyApiFallback: true,
13-
proxy: {
14-
'/pyroscope': 'http://localhost:4040',
15-
'/querier.v1.QuerierService': 'http://localhost:4040',
16-
'/assets/grafana/*': {
13+
proxy: [
14+
{
15+
context: ['/pyroscope'],
16+
target: 'http://localhost:4040',
17+
changeOrigin: true,
18+
},
19+
{
20+
context: ['/querier.v1.QuerierService'],
21+
target: 'http://localhost:4040',
22+
changeOrigin: true,
23+
},
24+
{
25+
context: ['/assets/grafana'],
1726
target: 'http://localhost:4041',
1827
pathRewrite: { '^/assets': '' },
1928
logLevel: 'debug',
2029
},
21-
},
30+
],
2231
},
2332
optimization: {
2433
runtimeChunk: 'single',

0 commit comments

Comments
 (0)