feat(frontend): make enterprise work
This commit is contained in:
+7
-8
@@ -104,15 +104,14 @@ import { createSystemVariableAdapter } from './features/variables/system/adapter
|
||||
import { createTextBoxVariableAdapter } from './features/variables/textbox/adapter';
|
||||
import { configureStore } from './store/configureStore';
|
||||
|
||||
// import symlinked extensions
|
||||
// TODO: Vite has no require.context support yet. Enterprise will need some thought.
|
||||
// const extensionsIndex = require.context('.', true, /extensions\/index.ts/);
|
||||
const extensionsIndex = (key: string) => ({});
|
||||
extensionsIndex.keys = () => [];
|
||||
type ExtensionExports = {
|
||||
init: () => void;
|
||||
addExtensionReducers: () => void;
|
||||
};
|
||||
|
||||
const extensionsExports = extensionsIndex.keys().map((key) => {
|
||||
return extensionsIndex(key);
|
||||
});
|
||||
// import symlinked extensions (use glob so vite doesn't error if no files are found)
|
||||
const extensions: Record<string, ExtensionExports> = import.meta.glob('./extensions/index.ts', { eager: true });
|
||||
const extensionsExports = Object.values(extensions);
|
||||
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
initDevFeatures();
|
||||
|
||||
+2
-3
@@ -15,7 +15,7 @@ export default defineConfig({
|
||||
input: ['./public/app/index.ts', './public/sass/grafana.dark.scss', './public/sass/grafana.light.scss'],
|
||||
},
|
||||
outDir: './build',
|
||||
assetsDir: './',
|
||||
assetsDir: './assets',
|
||||
},
|
||||
server: {
|
||||
// vite binds to ipv6 by default... and that doesn't work for me locally on mac...
|
||||
@@ -61,14 +61,13 @@ export default defineConfig({
|
||||
replacement: '@grafana/schema/src/$1',
|
||||
},
|
||||
],
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json'],
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
This is a Vite plugin for handling angular templates.
|
||||
https://vitejs.dev/guide/api-plugin.html#simple-examples
|
||||
|
||||
|
||||
The webpack output from https://github.com/WearyMonkey/ngtemplate-loader looks like this:
|
||||
var code = "\n<div class=\"graph-annotation\">\n\t<div class=\"graph-annotation__header\">\n\t\t</div></div>\n";
|
||||
Exports
|
||||
|
||||
Reference in New Issue
Block a user