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% defaults
last 2 versions cover 95% in US
not ie <= 8 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/lodash-es": "^4.17.6",
"@types/luxon": "^3.2.0", "@types/luxon": "^3.2.0",
"@types/uuid": "catalog:", "@types/uuid": "catalog:",
"@vitejs/plugin-legacy": "^6.0.0",
"@vitejs/plugin-vue": "catalog:frontend", "@vitejs/plugin-vue": "catalog:frontend",
"@vitest/coverage-v8": "catalog:frontend", "@vitest/coverage-v8": "catalog:frontend",
"browserslist-to-esbuild": "^2.1.1",
"miragejs": "^0.1.48", "miragejs": "^0.1.48",
"unplugin-icons": "^0.19.0", "unplugin-icons": "^0.19.0",
"unplugin-vue-components": "^0.27.2", "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 icons from 'unplugin-icons/vite';
import iconsResolver from 'unplugin-icons/resolver'; import iconsResolver from 'unplugin-icons/resolver';
import components from 'unplugin-vue-components/vite'; 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 publicPath = process.env.VUE_APP_PUBLIC_PATH || '/';
const { NODE_ENV } = process.env; const { NODE_ENV } = process.env;
const browsers = browserslist.loadConfig({ path: process.cwd() });
const alias = [ const alias = [
{ find: '@', replacement: resolve(__dirname, 'src') }, { find: '@', replacement: resolve(__dirname, 'src') },
{ find: 'stream', replacement: 'stream-browserify' }, { find: 'stream', replacement: 'stream-browserify' },
@ -54,6 +59,11 @@ const plugins = [
], ],
}), }),
vue(), vue(),
legacy({
modernTargets: browsers,
modernPolyfills: true,
renderLegacyChunks: false,
}),
]; ];
const { RELEASE: release } = process.env; const { RELEASE: release } = process.env;
@ -80,6 +90,7 @@ export default mergeConfig(
build: { build: {
minify: !!release, minify: !!release,
sourcemap: !!release, sourcemap: !!release,
target: browserslistToEsbuild(browsers),
}, },
}), }),
vitestConfig, vitestConfig,

File diff suppressed because it is too large Load diff