Fixed storybook failing to load due @tryghost/nql usage (#18453)

no refs

storybook was failing to load due to `@tryghost/nql` usage and the
global `vite` config not being used
This commit is contained in:
Michael Barrett 2023-10-03 16:49:05 +01:00 committed by GitHub
parent 84520f86f7
commit 2373a51ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
import {resolve} from "path";
import type { StorybookConfig } from "@storybook/react-vite";
const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
@ -20,6 +21,8 @@ const config: StorybookConfig = {
async viteFinal(config, options) {
config.resolve.alias = {
crypto: require.resolve('rollup-plugin-node-builtins'),
// @TODO: Remove this when @tryghost/nql is updated
mingo: resolve(__dirname, '../../../node_modules/mingo/dist/mingo.js')
}
return config;
},