2023-11-20 16:30:15 +03:00
|
|
|
import adminXViteConfig from '@tryghost/admin-x-framework/vite';
|
|
|
|
import pkg from './package.json';
|
|
|
|
import {resolve} from 'path';
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default (function viteConfig() {
|
|
|
|
return adminXViteConfig({
|
|
|
|
packageName: pkg.name,
|
|
|
|
entry: resolve(__dirname, 'src/index.tsx'),
|
|
|
|
overrides: {
|
|
|
|
define: {
|
|
|
|
'process.env.DEBUG': false // Shim env var utilized by the @tryghost/nql package
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
// Shim node modules utilized by the @tryghost/nql package
|
|
|
|
alias: {
|
|
|
|
fs: 'node-shim.cjs',
|
|
|
|
path: 'node-shim.cjs',
|
|
|
|
util: 'node-shim.cjs',
|
|
|
|
// @TODO: Remove this when @tryghost/nql is updated
|
|
|
|
mingo: resolve(__dirname, '../../node_modules/mingo/dist/mingo.js')
|
|
|
|
}
|
2024-03-12 23:40:33 +03:00
|
|
|
},
|
|
|
|
optimizeDeps: {
|
|
|
|
include: ['@tryghost/kg-unsplash-selector']
|
2023-11-20 16:30:15 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|