mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
fix: Rename chat.css to style.css in chat package build (#16622) (no-changelog)
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -50,5 +50,5 @@ Modify the import paths in `templates.ts` to point to your local server:
|
||||
```
|
||||
|
||||
```html
|
||||
<link href="https://127.0.0.1:8443/chat.css" rel="stylesheet" />
|
||||
<link href="https://127.0.0.1:8443/style.css" rel="stylesheet" />
|
||||
```
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { defineConfig, mergeConfig } from 'vite';
|
||||
import { resolve } from 'path';
|
||||
import { renameSync } from 'fs';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import icons from 'unplugin-icons/vite';
|
||||
import dts from 'vite-plugin-dts';
|
||||
@@ -18,6 +19,21 @@ export default mergeConfig(
|
||||
autoInstall: true,
|
||||
}),
|
||||
dts(),
|
||||
{
|
||||
name: 'rename-css-file',
|
||||
closeBundle() {
|
||||
// The chat.css is automatically named based on vite.config.ts library name.
|
||||
// ChatTrigger Node requires https://cdn.jsdelivr.net/npm/@n8n/chat/dist/style.css
|
||||
// As such for backwards compatibility, we need to maintain the same name file
|
||||
const cssPath = resolve(__dirname, 'dist', 'chat.css');
|
||||
const newCssPath = resolve(__dirname, 'dist', 'style.css');
|
||||
try {
|
||||
renameSync(cssPath, newCssPath);
|
||||
} catch (error) {
|
||||
console.error('Failed to rename chat.css file:', error);
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Reference in New Issue
Block a user