Commit Graph

3 Commits

Author SHA1 Message Date
Eric Eastwood bc900f99b5
Make sure we still convert from CommonJS to ESM even when symlinking `hydrogen-view-sdk` locally (#188)
References:

 - https://github.com/rollup/plugins/tree/master/packages/commonjs#usage-with-symlinks
 - https://vitejs.dev/config/shared-options.html#resolve-preservesymlinks
 - https://github.com/vitejs/vite/issues/2405 -> https://github.com/vitejs/vite/pull/4708/files
 - https://rollupjs.org/configuration-options/#preservesymlinks
2023-04-26 15:38:50 -05:00
Eric Eastwood 2c12fec1e6
Fix scripts not loading from the production ready build PR (#183)
Follow-up to https://github.com/matrix-org/matrix-public-archive/pull/175
2023-04-25 03:54:49 -05:00
Eric Eastwood 9c0b6fe85e
Production ready build (#175)
- Rename `public` -> `client` so it doesn't get copied automagically as-is (without hashes which we want for cache busting), https://vitejs.dev/guide/assets.html#the-public-directory
     - We still build the version files to `public/` so their copied as-is and Vite handles it for us (so we can use `emptyOutDir`) 
 - Use a multiple entrypoint `.js` Vite build so things can be more intelligently bundled and take less time
     - We aren't using library mode because it doesn't minify or bundle assets
 - Using hash asset tags for cache busting. Hash of the file included in the file name
 - We lookup these hashed assets from `manifest.json` that Vite builds (https://vitejs.dev/guide/backend-integration.html) to serve and preload
 - In terms of optimized bundles, I know the current output isn't great now but will have to opt to fix that up separately in the future. Tracked by https://github.com/matrix-org/matrix-public-archive/issues/176
2023-04-24 23:50:53 -05:00