mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 20:54:07 -08:00
fix(editor): Fix Vite dev mode (no-changelog) (#5475)
because of the updated dev tooling in https://github.com/n8n-io/n8n/pull/5454, vite dev mode is crashing because of the `util` package looking for `process.env`.
This commit is contained in:
parent
36108f82a1
commit
522ddfc0cd
|
@ -51,11 +51,14 @@ const lodashAliases = ['orderBy', 'camelCase', 'cloneDeep', 'isEqual', 'startCas
|
||||||
replacement: require.resolve(`lodash-es/${name}`),
|
replacement: require.resolve(`lodash-es/${name}`),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const { NODE_ENV } = process.env;
|
||||||
|
|
||||||
export default mergeConfig(
|
export default mergeConfig(
|
||||||
defineConfig({
|
defineConfig({
|
||||||
define: {
|
define: {
|
||||||
// This causes test to fail but is required for actually running it
|
// This causes test to fail but is required for actually running it
|
||||||
...(process.env.NODE_ENV !== 'test' ? { global: 'globalThis' } : {}),
|
...(NODE_ENV !== 'test' ? { global: 'globalThis' } : {}),
|
||||||
|
...(NODE_ENV === 'development' ? { process: { env: {} } } : {}),
|
||||||
BASE_PATH: `'${publicPath}'`,
|
BASE_PATH: `'${publicPath}'`,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
Loading…
Reference in a new issue