mirror of
				https://github.com/cinnyapp/cinny.git
				synced 2025-11-04 06:20:28 +03:00 
			
		
		
		
	Add authenticated media support (#1930)
* chore: Bump matrix-js-sdk to 34.4.0 * feat: Authenticated media support * chore: Use Vite PWA for service worker support * fix: Fix Vite PWA SW entry point Forget this. :P * fix: Also add Nginx rewrite for sw.js * fix: Correct Nginx rewrite * fix: Add Netlify redirect for sw.js Otherwise the generic SPA rewrite to index.html would take effect, breaking Service Worker. * fix: Account for subpath when regisering service worker * chore: Correct types
This commit is contained in:
		
							parent
							
								
									043012e809
								
							
						
					
					
						commit
						c6a8fb1117
					
				
					 46 changed files with 3562 additions and 487 deletions
				
			
		| 
						 | 
				
			
			@ -6,6 +6,7 @@ import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
 | 
			
		|||
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill';
 | 
			
		||||
import inject from '@rollup/plugin-inject';
 | 
			
		||||
import topLevelAwait from 'vite-plugin-top-level-await';
 | 
			
		||||
import { VitePWA } from 'vite-plugin-pwa';
 | 
			
		||||
import buildConfig from './build.config';
 | 
			
		||||
 | 
			
		||||
const copyFiles = {
 | 
			
		||||
| 
						 | 
				
			
			@ -50,11 +51,11 @@ export default defineConfig({
 | 
			
		|||
    port: 8080,
 | 
			
		||||
    host: true,
 | 
			
		||||
    proxy: {
 | 
			
		||||
      "^\\/.*?\\/olm\\.wasm$": {
 | 
			
		||||
      '^\\/.*?\\/olm\\.wasm$': {
 | 
			
		||||
        target: 'http://localhost:8080',
 | 
			
		||||
        rewrite: () => '/olm.wasm'
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
        rewrite: () => '/olm.wasm',
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  plugins: [
 | 
			
		||||
    topLevelAwait({
 | 
			
		||||
| 
						 | 
				
			
			@ -67,6 +68,16 @@ export default defineConfig({
 | 
			
		|||
    vanillaExtractPlugin(),
 | 
			
		||||
    wasm(),
 | 
			
		||||
    react(),
 | 
			
		||||
    VitePWA({
 | 
			
		||||
      srcDir: 'src',
 | 
			
		||||
      filename: 'sw.ts',
 | 
			
		||||
      strategies: 'injectManifest',
 | 
			
		||||
      injectRegister: false,
 | 
			
		||||
      manifest: false,
 | 
			
		||||
      injectManifest: {
 | 
			
		||||
        injectionPoint: undefined,
 | 
			
		||||
      },
 | 
			
		||||
    }),
 | 
			
		||||
  ],
 | 
			
		||||
  optimizeDeps: {
 | 
			
		||||
    esbuildOptions: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue