commit 143dbf5c65219a88760efdde294d60371448236f
parent 00a7481bda286250a7cdfcc0052db9c20041fd05
Author: MTRNord <mtrnord1@gmail.com>
Date: Thu, 31 Mar 2022 03:09:14 +0200
Use better bundling and make sure preact debug things are not in prod builds
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main.tsx b/src/main.tsx
@@ -8,7 +8,7 @@ import olmWasmPath from "@matrix-org/olm/olm.wasm?url";
import OlmLegacy from '@matrix-org/olm/olm_legacy.js?url';
import Olm from '@matrix-org/olm';
-if (import.meta.env.NODE_ENV === 'development') {
+if (import.meta.env.DEV) {
// Must use require here as import statements are only allowed
// to exist at top-level.
// @ts-ignore No types
diff --git a/vite.config.ts b/vite.config.ts
@@ -1,9 +1,9 @@
-import { defineConfig } from 'vite';
+import { defineConfig, splitVendorChunkPlugin } from 'vite';
import preact from '@preact/preset-vite';
// https://vitejs.dev/config/
export default defineConfig({
- plugins: [preact()],
+ plugins: [preact(), splitVendorChunkPlugin()],
resolve: {
alias: {
react: 'preact/compat',