From f72699db08ca28fbb4d2928f93a9c8aa4775c5ec Mon Sep 17 00:00:00 2001 From: ChaosExAnima Date: Tue, 1 Apr 2025 12:12:40 +0200 Subject: [PATCH] changes entrypoints and tweaks manifest augmenter --- app/javascript/entrypoints/index.html | 8 -------- config/vite/plugin-manifest-sri.ts | 23 ++--------------------- vite.config.ts | 11 +++++++++++ 3 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 app/javascript/entrypoints/index.html diff --git a/app/javascript/entrypoints/index.html b/app/javascript/entrypoints/index.html deleted file mode 100644 index 025030ba46d..00000000000 --- a/app/javascript/entrypoints/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -
- - diff --git a/config/vite/plugin-manifest-sri.ts b/config/vite/plugin-manifest-sri.ts index 4c768abfa5e..e940e35a63b 100644 --- a/config/vite/plugin-manifest-sri.ts +++ b/config/vite/plugin-manifest-sri.ts @@ -13,13 +13,6 @@ export interface Options { * @default ['sha384'] */ algorithms?: Algorithm[]; - - /** - * Path of the manifest files that should be read and augmented with the - * integrity hash, relative to `outDir`. - * @default ['manifest.json', 'manifest-assets.json'] - */ - manifestPaths?: string[]; } declare module 'vite' { @@ -29,26 +22,14 @@ declare module 'vite' { } export function manifestSRI(options: Options = {}): Plugin { - const { - algorithms = ['sha384'], - manifestPaths = [ - '.vite/manifest.json', - '.vite/manifest-assets.json', - 'manifest.json', - 'manifest-assets.json', - ], - } = options; + const { algorithms = ['sha384'] } = options; return { name: 'vite-plugin-manifest-sri', apply: 'build', enforce: 'post', async writeBundle({ dir }) { - await Promise.all( - manifestPaths.map((path) => - augmentManifest(path, algorithms, dir ?? ''), - ), - ); + await augmentManifest('manifest.json', algorithms, dir ?? ''); }, }; } diff --git a/vite.config.ts b/vite.config.ts index f7fe769e09d..64ece6bcb4f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,6 +13,17 @@ export default defineConfig({ emptyOutDir: true, manifest: 'manifest.json', rollupOptions: { + input: { + admin: path.resolve(__dirname, 'app/javascript/entrypoints/admin.tsx'), + application: path.resolve( + __dirname, + 'app/javascript/entrypoints/application.ts', + ), + twoFactor: path.resolve( + __dirname, + 'app/javascript/entrypoints/two_factor_authentication.ts', + ), + }, output: { chunkFileNames: (chunkInfo) => { if (