mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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 legacy from '@vitejs/plugin-legacy';
|
||||||
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
|
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
|
||||||
import path, { resolve } from 'path';
|
import path, { resolve } from 'path';
|
||||||
import { defineConfig, mergeConfig, PluginOption } from 'vite';
|
import { defineConfig, mergeConfig } from 'vite';
|
||||||
import { defineConfig as defineVitestConfig } from 'vitest/config';
|
import { defineConfig as defineVitestConfig } from 'vitest/config';
|
||||||
|
|
||||||
import packageJSON from './package.json';
|
import packageJSON from './package.json';
|
||||||
|
|
||||||
|
const isCI = process.env.CI === 'true';
|
||||||
|
|
||||||
const vendorChunks = ['vue', 'vue-router'];
|
const vendorChunks = ['vue', 'vue-router'];
|
||||||
const n8nChunks = ['n8n-workflow', 'n8n-design-system'];
|
const n8nChunks = ['n8n-workflow', 'n8n-design-system'];
|
||||||
const ignoreChunks = [
|
const ignoreChunks = [
|
||||||
|
@ -57,15 +59,19 @@ export default mergeConfig(
|
||||||
BASE_PATH: `'${publicPath}'`,
|
BASE_PATH: `'${publicPath}'`,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
legacy({
|
|
||||||
targets: ['defaults', 'not IE 11'],
|
|
||||||
}),
|
|
||||||
vue(),
|
vue(),
|
||||||
monacoEditorPlugin({
|
...(!isCI
|
||||||
publicPath: 'assets/monaco-editor',
|
? [
|
||||||
customDistPath: (root: string, buildOutDir: string, base: string) =>
|
legacy({
|
||||||
`${root}/${buildOutDir}/assets/monaco-editor`,
|
targets: ['defaults', 'not IE 11'],
|
||||||
}) as PluginOption,
|
}),
|
||||||
|
monacoEditorPlugin({
|
||||||
|
publicPath: 'assets/monaco-editor',
|
||||||
|
customDistPath: (root: string, buildOutDir: string, base: string) =>
|
||||||
|
`${root}/${buildOutDir}/assets/monaco-editor`,
|
||||||
|
}),
|
||||||
|
]
|
||||||
|
: []),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: [
|
alias: [
|
||||||
|
@ -104,9 +110,11 @@ export default mergeConfig(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
|
minify: !isCI,
|
||||||
assetsInlineLimit: 0,
|
assetsInlineLimit: 0,
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
|
treeshake: !isCI,
|
||||||
output: {
|
output: {
|
||||||
manualChunks: {
|
manualChunks: {
|
||||||
vendor: vendorChunks,
|
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