mirror of
https://github.com/grafana/grafana.git
synced 2025-07-25 16:23:49 +08:00
Build swagger ui in seperate webpack build (#102046)
* Build swagger ui in seperate webpack build * render grafana and swagger * include light theme * merge main * update webassets usage --------- Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
This commit is contained in:
@ -7,7 +7,6 @@ module.exports = {
|
||||
target: 'web',
|
||||
entry: {
|
||||
app: './public/app/index.ts',
|
||||
swagger: './public/swagger/index.tsx',
|
||||
},
|
||||
experiments: {
|
||||
// Required to load WASM modules.
|
||||
|
27
scripts/webpack/webpack.swagger.js
Normal file
27
scripts/webpack/webpack.swagger.js
Normal file
@ -0,0 +1,27 @@
|
||||
// @ts-check
|
||||
const path = require('path');
|
||||
|
||||
const makeBaseConfig = require('./webpack.prod.js');
|
||||
|
||||
module.exports = (env = {}) => {
|
||||
const baseConfig = makeBaseConfig(env);
|
||||
|
||||
return {
|
||||
...baseConfig,
|
||||
|
||||
entry: {
|
||||
app: './public/swagger/index.tsx',
|
||||
light: './public/sass/grafana.light.scss',
|
||||
},
|
||||
|
||||
// Output to a different directory so each build doesn't clobber each other
|
||||
output: {
|
||||
...baseConfig.output,
|
||||
clean: true,
|
||||
path: path.resolve(__dirname, '../../public/build-swagger'),
|
||||
filename: '[name].[contenthash].js',
|
||||
// Keep publicPath relative for host.com/grafana/ deployments
|
||||
publicPath: 'public/build-swagger/',
|
||||
},
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user