Skip to content

Commit

Permalink
Minify and disable live reload for production builds
Browse files Browse the repository at this point in the history
  • Loading branch information
unstubbable committed Oct 10, 2023
1 parent 6d8c1de commit 62b72c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as esbuild from 'esbuild';
import {options} from './esbuild-options.js';

await esbuild.build(options);
await esbuild.build({...options, minify: true});
6 changes: 5 additions & 1 deletion src/integrator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@ root.render(
</React.StrictMode>,
);

new EventSource('/esbuild').addEventListener('change', () => location.reload());
if (process.env.NODE_ENV !== 'production') {
new EventSource('/esbuild').addEventListener('change', () =>
location.reload(),
);
}

0 comments on commit 62b72c8

Please sign in to comment.