diff --git a/packages/editor-ui/vite.config.ts b/packages/editor-ui/vite.config.ts index 7508d04578..1c8cffa294 100644 --- a/packages/editor-ui/vite.config.ts +++ b/packages/editor-ui/vite.config.ts @@ -2,11 +2,13 @@ import vue from '@vitejs/plugin-vue2'; import legacy from '@vitejs/plugin-legacy'; import monacoEditorPlugin from 'vite-plugin-monaco-editor'; import path, { resolve } from 'path'; -import { defineConfig, mergeConfig, PluginOption } from 'vite'; +import { defineConfig, mergeConfig } from 'vite'; import { defineConfig as defineVitestConfig } from 'vitest/config'; import packageJSON from './package.json'; +const isCI = process.env.CI === 'true'; + const vendorChunks = ['vue', 'vue-router']; const n8nChunks = ['n8n-workflow', 'n8n-design-system']; const ignoreChunks = [ @@ -57,15 +59,19 @@ export default mergeConfig( BASE_PATH: `'${publicPath}'`, }, plugins: [ - legacy({ - targets: ['defaults', 'not IE 11'], - }), vue(), - monacoEditorPlugin({ - publicPath: 'assets/monaco-editor', - customDistPath: (root: string, buildOutDir: string, base: string) => - `${root}/${buildOutDir}/assets/monaco-editor`, - }) as PluginOption, + ...(!isCI + ? [ + legacy({ + targets: ['defaults', 'not IE 11'], + }), + monacoEditorPlugin({ + publicPath: 'assets/monaco-editor', + customDistPath: (root: string, buildOutDir: string, base: string) => + `${root}/${buildOutDir}/assets/monaco-editor`, + }), + ] + : []), ], resolve: { alias: [ @@ -104,9 +110,11 @@ export default mergeConfig( }, }, build: { + minify: !isCI, assetsInlineLimit: 0, sourcemap: false, rollupOptions: { + treeshake: !isCI, output: { manualChunks: { vendor: vendorChunks, diff --git a/packages/editor-ui/vue.config.js b/packages/editor-ui/vue.config.js deleted file mode 100644 index bff148b432..0000000000 --- a/packages/editor-ui/vue.config.js +++ /dev/null @@ -1,49 +0,0 @@ -const path = require('path'); -const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin'); - -module.exports = { - chainWebpack: (config) => { - config.resolve.symlinks(false); - // config.plugins.delete("prefetch"); // enable when language package grows - }, - pluginOptions: { - webpackBundleAnalyzer: { - openAnalyzer: false, - }, - i18n: { - locale: 'en', - fallbackLocale: 'en', - localeDir: './src/i18n/locales', - enableInSFC: false, - }, - }, - configureWebpack: { - devServer: { - disableHostCheck: true, - }, - plugins: [new MonacoWebpackPlugin({ languages: ['javascript', 'json', 'typescript'] })], - resolve: { - alias: { - 'element-ui/packages/button': path.resolve( - __dirname, - '..', - 'design-system/src/components/N8nButton/overrides/ElButton.vue', - ), - 'element-ui/lib/button': path.resolve( - __dirname, - '..', - 'design-system/src/components/N8nButton/overrides/ElButton.vue', - ), - }, - }, - }, - css: { - loaderOptions: { - sass: { - prependData: ` - @import "@/n8n-theme-variables.scss"; - `, - }, - }, - }, -};