mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(editor): Fix broken types for globally defined components (no-changelog) (#16505)
Co-authored-by: Mutasem Aldmour <mutasem@n8n.io>
This commit is contained in:
@@ -5,9 +5,12 @@ import vue from '@vitejs/plugin-vue';
|
||||
import icons from 'unplugin-icons/vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
import { vitestConfig } from '@n8n/vitest-config/frontend';
|
||||
import iconsResolver from 'unplugin-icons/resolver';
|
||||
import components from 'unplugin-vue-components/vite';
|
||||
|
||||
const includeVue = process.env.INCLUDE_VUE === 'true';
|
||||
const srcPath = resolve(__dirname, 'src');
|
||||
const packagesDir = resolve(__dirname, '..', '..', '..');
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default mergeConfig(
|
||||
@@ -19,6 +22,18 @@ export default mergeConfig(
|
||||
autoInstall: true,
|
||||
}),
|
||||
dts(),
|
||||
components({
|
||||
dts: './src/components.d.ts',
|
||||
resolvers: [
|
||||
(componentName) => {
|
||||
if (componentName.startsWith('N8n'))
|
||||
return { name: componentName, from: '@n8n/design-system' };
|
||||
},
|
||||
iconsResolver({
|
||||
prefix: 'icon',
|
||||
}),
|
||||
],
|
||||
}),
|
||||
{
|
||||
name: 'rename-css-file',
|
||||
closeBundle() {
|
||||
@@ -36,10 +51,24 @@ export default mergeConfig(
|
||||
},
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': srcPath,
|
||||
'@n8n/chat': srcPath,
|
||||
},
|
||||
alias: [
|
||||
{
|
||||
find: '@',
|
||||
replacement: srcPath,
|
||||
},
|
||||
{
|
||||
find: '@n8n/chat',
|
||||
replacement: srcPath,
|
||||
},
|
||||
{
|
||||
find: /^@n8n\/chat(.+)$/,
|
||||
replacement: srcPath + '$1',
|
||||
},
|
||||
{
|
||||
find: /^@n8n\/design-system(.+)$/,
|
||||
replacement: resolve(packagesDir, 'frontend', '@n8n', 'design-system', 'src$1'),
|
||||
},
|
||||
],
|
||||
},
|
||||
define: {
|
||||
'process.env.NODE_ENV': process.env.NODE_ENV ? `"${process.env.NODE_ENV}"` : '"development"',
|
||||
|
||||
Reference in New Issue
Block a user