diff --git a/build.js b/build.js index 77e9cc0..4f4bf37 100644 --- a/build.js +++ b/build.js @@ -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}); diff --git a/src/integrator.tsx b/src/integrator.tsx index c54c892..e24dcd3 100644 --- a/src/integrator.tsx +++ b/src/integrator.tsx @@ -18,4 +18,8 @@ root.render( , ); -new EventSource('/esbuild').addEventListener('change', () => location.reload()); +if (process.env.NODE_ENV !== 'production') { + new EventSource('/esbuild').addEventListener('change', () => + location.reload(), + ); +}