File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,17 @@ const root = ReactDOM.createRoot(container);
23
23
24
24
setupReduxQuerySync ( ) ;
25
25
26
+ declare global {
27
+ interface Window {
28
+ __grafana_public_path__ : string ;
29
+ }
30
+ }
31
+
32
+ if ( typeof window !== 'undefined' ) {
33
+ // Icons from @grafana /ui are not bundled, this forces them to be loaded via a CDN instead.
34
+ window . __grafana_public_path__ = 'assets/grafana/' ;
35
+ }
36
+
26
37
function App ( ) {
27
38
useSelectFirstApp ( ) ;
28
39
Original file line number Diff line number Diff line change 1
- const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
1
+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
2
+
2
3
const path = require ( 'path' ) ;
3
4
const MiniCssExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
4
- //const { dependencies: pyroOSSDeps } = require('../../og/package.json');
5
- const webpack = require ( 'webpack' ) ;
6
- const TsconfigPathsPlugin = require ( 'tsconfig-paths-webpack-plugin' ) ;
7
-
8
- // this is so that we don't import dependencies twice, once from pyroscope-oss and another from here
9
- // const deps = Object.entries(pyroOSSDeps).reduce((prev, [name]) => {
10
- // return {
11
- // ...prev,
12
- // [name]: path.resolve(__dirname, `../../node_modules/${name}`),
13
- // };
14
- // }, {});
15
5
16
6
module . exports = {
17
7
target : 'web' ,
@@ -58,6 +48,14 @@ module.exports = {
58
48
new MiniCssExtractPlugin ( {
59
49
filename : '[name].[contenthash].css' ,
60
50
} ) ,
51
+ new CopyWebpackPlugin ( {
52
+ patterns : [
53
+ {
54
+ from : 'node_modules/@grafana/ui/dist/public/img/icons' ,
55
+ to : 'grafana/img/icons/' ,
56
+ } ,
57
+ ] ,
58
+ } ) ,
61
59
] ,
62
60
module : {
63
61
rules : [
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ module.exports = merge(common, {
13
13
proxy : {
14
14
'/pyroscope' : 'http://localhost:4040' ,
15
15
'/querier.v1.QuerierService' : 'http://localhost:4040' ,
16
+ '/assets/grafana/*' : {
17
+ target : 'http://localhost:4041' ,
18
+ pathRewrite : { '^/assets' : '' } ,
19
+ logLevel : 'debug' ,
20
+ } ,
16
21
} ,
17
22
} ,
18
23
optimization : {
You can’t perform that action at this time.
0 commit comments