Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/agentflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"*.css"
],
"scripts": {
"build": "tsc && cross-env NODE_ENV=production vite build",
"build": "tsc && vite build",
"clean": "rimraf dist",
"dev": "cross-env NODE_ENV=development vite",
"dev:example": "cross-env NODE_ENV=development vite --config examples/vite.config.ts",
"dev": "vite",
"dev:example": "vite --config examples/vite.config.ts",
"format": "prettier --write \"{src,examples}/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"format:check": "prettier --check \"{src,examples}/**/*.{ts,tsx,js,jsx,json,css,md}\"",
"lint": "eslint \"{src,examples/src}/**/*.{js,jsx,ts,tsx,json,md}\"",
Expand Down Expand Up @@ -89,7 +89,6 @@
"eslint-plugin-simple-import-sort": "^12.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"cross-env": "^7.0.3",
"rimraf": "^5.0.5",
"ts-jest": "^29.3.2",
"typescript": "^5.4.5",
Expand Down
104 changes: 53 additions & 51 deletions packages/agentflow/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,59 +3,61 @@ import react from '@vitejs/plugin-react'
import dts from 'vite-plugin-dts'
import { resolve } from 'path'

const isDev = process.env.NODE_ENV === 'development'
export default defineConfig(({ mode }) => {
const isDev = mode === 'development'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the doc you shared https://vite.dev/guide/env-and-mode#modes, we don't even need to pass in mode since build script will by default be production

Copy link
Copy Markdown
Contributor Author

@sohaieb sohaieb Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi
You are completely right @jocelynlin-wd , thank you for the catch !

Basing on the following announced remark in Vite - Env and Mode Doc:

By default, the dev server (dev command) runs in development mode and the build command runs in production mode.

I will keep the code above as we still need it to specify the sourceMap config according to the environment/mode, but I will adjust the package.json scripts instead.

Copy link
Copy Markdown
Contributor Author

@sohaieb sohaieb Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi again @jocelynlin-wd ,
I made the updates according to our discussion,

In the meanwhile, another topic: I created another PR to add LMStudio support too and it fixes some UI issues.

I would really appreciate a lot if you review both PRs 😃
Thank you so much 🙏


export default defineConfig({
plugins: [
react(),
dts({
insertTypesEntry: true,
include: ['src/**/*'],
exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'src/__test_utils__/**']
})
],
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
},
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'FlowiseAgentflow',
formats: ['es', 'umd'],
fileName: (format) => `index.${format === 'es' ? 'js' : 'umd.js'}`
},
rollupOptions: {
external: [
'react',
'react-dom',
'react/jsx-runtime',
'@mui/material',
'@mui/material/styles',
'@mui/icons-material',
'@emotion/react',
'@emotion/styled',
'reactflow'
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'react/jsx-runtime': 'jsxRuntime',
'@mui/material': 'MaterialUI',
'@mui/material/styles': 'MaterialUIStyles',
'@emotion/react': 'emotionReact',
'@emotion/styled': 'emotionStyled',
reactflow: 'ReactFlow'
},
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') return 'flowise.css'
return assetInfo.name || 'asset'
}
return {
plugins: [
react(),
dts({
insertTypesEntry: true,
include: ['src/**/*'],
exclude: ['src/**/*.test.ts', 'src/**/*.test.tsx', 'src/__test_utils__/**']
})
],
resolve: {
alias: {
'@': resolve(__dirname, 'src')
}
},
cssCodeSplit: false,
sourcemap: isDev ? true : false
build: {
lib: {
entry: resolve(__dirname, 'src/index.ts'),
name: 'FlowiseAgentflow',
formats: ['es', 'umd'],
fileName: (format) => `index.${format === 'es' ? 'js' : 'umd.js'}`
},
rollupOptions: {
external: [
'react',
'react-dom',
'react/jsx-runtime',
'@mui/material',
'@mui/material/styles',
'@mui/icons-material',
'@emotion/react',
'@emotion/styled',
'reactflow'
],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'react/jsx-runtime': 'jsxRuntime',
'@mui/material': 'MaterialUI',
'@mui/material/styles': 'MaterialUIStyles',
'@emotion/react': 'emotionReact',
'@emotion/styled': 'emotionStyled',
reactflow: 'ReactFlow'
},
assetFileNames: (assetInfo) => {
if (assetInfo.name === 'style.css') return 'flowise.css'
return assetInfo.name || 'asset'
}
}
},
cssCodeSplit: false,
sourcemap: isDev ? true : false
}
}
})
24 changes: 6 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading