refactor: module federation
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -72,15 +72,16 @@ export default defineConfig(({ mode }) => ({
|
||||
input: {
|
||||
public: path.resolve(__dirname, 'core/src/public.html'),
|
||||
private: path.resolve(__dirname, 'core/src/private.html'),
|
||||
'shared-utils': path.resolve(__dirname, 'core/src/utils/helpers/shared.ts'),
|
||||
'ktxc': path.resolve(__dirname, 'core/src/shared/index.ts'),
|
||||
},
|
||||
preserveEntrySignatures: 'exports-only',
|
||||
output: {
|
||||
// Preserve export names for shared-utils (used via import map by modules)
|
||||
// Preserve export names for ktxc (used via import map by modules)
|
||||
minifyInternalExports: false,
|
||||
entryFileNames: (chunkInfo) => {
|
||||
// Keep shared-utils without hash for stable import map reference
|
||||
if (chunkInfo.name === 'shared-utils') {
|
||||
return `js/[name].js`;
|
||||
// Keep ktxc without hash for stable import map references
|
||||
if (chunkInfo.name === 'ktxc') {
|
||||
return `js/ktxc.mjs`;
|
||||
}
|
||||
return `js/[name]-[hash].js`;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user