From d436070c773858fabfdc1069e5d03f0bd237858e Mon Sep 17 00:00:00 2001 From: QuocViet Le Date: Wed, 31 Jul 2024 14:07:01 -0500 Subject: [PATCH 1/2] Update plugin-factory.ts Adding support to output.entryFileNames --- src/plugin-factory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-factory.ts b/src/plugin-factory.ts index af2a8f0..0c00906 100644 --- a/src/plugin-factory.ts +++ b/src/plugin-factory.ts @@ -178,7 +178,7 @@ export function pluginFactory(readFileFn?: (path: string, options: any) => Promi cfg.preview = { port: plugInConfig.serverPort }; - const entryFileNames = '[name].js'; + const entryFileNames = plugInConfig.entryFileNames && '[name].js'; const input: InputOption = {}; let preserveEntrySignatures: PreserveEntrySignaturesOption; if (viteOpts.command === 'build') { From e4da6446919794e632c0b5eb7a5d8b069866ede7 Mon Sep 17 00:00:00 2001 From: QuocViet Le Date: Wed, 31 Jul 2024 14:09:12 -0500 Subject: [PATCH 2/2] Update vite-plugin-single-spa.d.ts Add entryFileNames parameter to SingleSpaMifePluginOptions --- src/vite-plugin-single-spa.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vite-plugin-single-spa.d.ts b/src/vite-plugin-single-spa.d.ts index 6d7d12b..fc54ec4 100644 --- a/src/vite-plugin-single-spa.d.ts +++ b/src/vite-plugin-single-spa.d.ts @@ -100,6 +100,14 @@ declare module "vite-plugin-single-spa" { * `vpss()`. The plug-in is smart enough to respect any folders in the pattern. */ assetFileNames?: string; + /** + * Pattern that specifies how entry file names are constructed. Its default value is + * `[name].js`. + * + * Refer to [Rollup's documentaiton](https://rollupjs.org/configuration-options/#output-entryfilenames) for + * additional information. + */ + entryFileNames?: string; } & DebuggingOptions; /**