mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-25 19:41:14 -08:00
ci(editor): Faster builds on the CI (no-changelog) (#5422)
This commit is contained in:
parent
e01192e7af
commit
00befbc75a
|
@ -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,
|
||||
|
|
|
@ -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";
|
||||
`,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue