Skip to content

Commit

Permalink
fix(editor): Fix Vite dev mode (no-changelog) (#5475)
Browse files Browse the repository at this point in the history
because of the updated dev tooling in #5454, vite dev mode is crashing because of the `util` package looking for `process.env`.
  • Loading branch information
netroy authored Feb 14, 2023
1 parent 36108f8 commit 522ddfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/editor-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ const lodashAliases = ['orderBy', 'camelCase', 'cloneDeep', 'isEqual', 'startCas
replacement: require.resolve(`lodash-es/${name}`),
}));

const { NODE_ENV } = process.env;

export default mergeConfig(
defineConfig({
define: {
// 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}'`,
},
plugins: [
Expand Down

0 comments on commit 522ddfc

Please sign in to comment.