mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
ci(editor): Apply monaco-editor alias override only during tests (no-changelog) (#5908)
This commit is contained in:
parent
77106520c8
commit
d08c885734
|
@ -43,27 +43,7 @@ const publicPath = process.env.VUE_APP_PUBLIC_PATH || '/';
|
|||
|
||||
const { NODE_ENV } = process.env;
|
||||
|
||||
export default mergeConfig(
|
||||
defineConfig({
|
||||
define: {
|
||||
// This causes test to fail but is required for actually running it
|
||||
...(NODE_ENV !== 'test' ? { global: 'globalThis' } : {}),
|
||||
...(NODE_ENV === 'development' ? { process: { env: {} } } : {}),
|
||||
BASE_PATH: `'${publicPath}'`,
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
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: [
|
||||
const alias = [
|
||||
{ find: '@', replacement: resolve(__dirname, 'src') },
|
||||
{ find: 'stream', replacement: 'stream-browserify' },
|
||||
{
|
||||
|
@ -90,8 +70,36 @@ export default mergeConfig(
|
|||
'design-system/src/components/N8nButton/overrides/ElButton.ts',
|
||||
),
|
||||
},
|
||||
],
|
||||
];
|
||||
|
||||
// https://github.com/vitest-dev/vitest/discussions/1806
|
||||
if (NODE_ENV === 'test') {
|
||||
alias.push({
|
||||
find: /^monaco-editor$/,
|
||||
replacement: __dirname + '/node_modules/monaco-editor/esm/vs/editor/editor.api',
|
||||
});
|
||||
}
|
||||
|
||||
export default mergeConfig(
|
||||
defineConfig({
|
||||
define: {
|
||||
// This causes test to fail but is required for actually running it
|
||||
...(NODE_ENV !== 'test' ? { global: 'globalThis' } : {}),
|
||||
...(NODE_ENV === 'development' ? { process: { env: {} } } : {}),
|
||||
BASE_PATH: `'${publicPath}'`,
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
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 },
|
||||
base: publicPath,
|
||||
envPrefix: 'VUE_APP',
|
||||
css: {
|
||||
|
@ -132,15 +140,5 @@ export default mergeConfig(
|
|||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: [
|
||||
// https://github.com/vitest-dev/vitest/discussions/1806
|
||||
{
|
||||
find: /^monaco-editor$/,
|
||||
replacement:
|
||||
__dirname + "/node_modules/monaco-editor/esm/vs/editor/editor.api",
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue