ci(editor): Faster builds on the CI (no-changelog) (#5422)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-02-09 15:47:34 +01:00 committed by GitHub
parent e01192e7af
commit 00befbc75a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 58 deletions

View file

@ -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,

View file

@ -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";
`,
},
},
},
};