build(editor): Improve browser support for the n8n editor (#12064)

This commit is contained in:
Elias Meire 2024-12-10 10:08:25 +01:00 committed by GitHub
parent 5fc3bf631d
commit a50969b244
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 1440 additions and 163 deletions

View file

@ -1,3 +1,3 @@
> 1%
last 2 versions
not ie <= 8
defaults
cover 95% in US
cover 95% in alt-EU and last 2 years and not dead and fully supports es6-module and fully supports es6-module-dynamic-import

View file

@ -95,8 +95,10 @@
"@types/lodash-es": "^4.17.6",
"@types/luxon": "^3.2.0",
"@types/uuid": "catalog:",
"@vitejs/plugin-legacy": "^6.0.0",
"@vitejs/plugin-vue": "catalog:frontend",
"@vitest/coverage-v8": "catalog:frontend",
"browserslist-to-esbuild": "^2.1.1",
"miragejs": "^0.1.48",
"unplugin-icons": "^0.19.0",
"unplugin-vue-components": "^0.27.2",

View file

@ -6,11 +6,16 @@ import { vitestConfig } from '../design-system/vite.config.mts';
import icons from 'unplugin-icons/vite';
import iconsResolver from 'unplugin-icons/resolver';
import components from 'unplugin-vue-components/vite';
import browserslistToEsbuild from 'browserslist-to-esbuild';
import legacy from '@vitejs/plugin-legacy';
import browserslist from 'browserslist';
const publicPath = process.env.VUE_APP_PUBLIC_PATH || '/';
const { NODE_ENV } = process.env;
const browsers = browserslist.loadConfig({ path: process.cwd() });
const alias = [
{ find: '@', replacement: resolve(__dirname, 'src') },
{ find: 'stream', replacement: 'stream-browserify' },
@ -54,6 +59,11 @@ const plugins = [
],
}),
vue(),
legacy({
modernTargets: browsers,
modernPolyfills: true,
renderLegacyChunks: false,
}),
];
const { RELEASE: release } = process.env;
@ -80,6 +90,7 @@ export default mergeConfig(
build: {
minify: !!release,
sourcemap: !!release,
target: browserslistToEsbuild(browsers),
},
}),
vitestConfig,

File diff suppressed because it is too large Load diff