|
|
5 meses atrás | |
|---|---|---|
| .. | ||
| src | 5 meses atrás | |
| README.md | 5 meses atrás | |
| package.json | 5 meses atrás | |
| tsconfig.build.json | 5 meses atrás | |
| tsconfig.json | 5 meses atrás | |
This plugin serves the static files of the Vendure Dashboard UI and provides the GraphQL extensions needed for the order metrics on the dashboard index page.
yarn add @vendure/dashboard-plugin
or
npm install @vendure/dashboard-plugin
import { DashboardPlugin } from '@vendure/dashboard-plugin';
const config: VendureConfig = {
// Add an instance of the plugin to the plugins array
plugins: [
DashboardPlugin.init({ route: 'dashboard' }),
],
};
The Dashboard UI will be served at the /dashboard/ path.
If you are building a stand-alone version of the Dashboard UI app and don't need this plugin to serve the Dashboard UI, you can still use the metricSummary query by adding the DashboardPlugin to the plugins array without calling the init() method:
import { DashboardPlugin } from '@vendure/dashboard-plugin';
const config: VendureConfig = {
plugins: [
DashboardPlugin, // <-- no call to .init()
],
// ...
};
You can also provide a custom build of the Dashboard UI:
import { DashboardPlugin } from '@vendure/dashboard-plugin';
const config: VendureConfig = {
plugins: [
DashboardPlugin.init({
route: 'dashboard',
app: path.join(__dirname, 'custom-dashboard-build'),
}),
],
};
route: string - The route at which the Dashboard UI will be served (default: 'dashboard')app?: string - Optional path to a custom build of the Dashboard UI