Using a different theme appears to result in lot of files #10103
|
In order to set the theme to sap_fiori_3, i needed to import '@ui5/webcomponents-react/dist/Assets', but the build step now generates over 300 files, instead of the normal 3 files. It looks like the files are catering for all the different languages and possibly other themes i don't need. Is there a way I can configure the build better? Thanks in advance. |
Replies: 2 comments
|
Hi @davidlam-winc assets are mostly implemented by the ui5 web components team, that's why I'll forward this question to their repo. |
|
the build tools are usually capable of marking certain modules as external and will not include them in the build result. Here is an example I made with vitejs, including only german and english for the message bundles: // vite.config.ts
import { defineConfig } from 'vite'
export default defineConfig({
build: {
rollupOptions: {
external: (id) => {
// messagebundle files in @ui5/webcomponents/dist folder
if (id.includes('@ui5/webcomponents/dist') && id.includes('messagebundle')) {
const keep = id.endsWith("messagebundle_de.json") || id.endsWith("messagebundle_en.json")
if (keep) {
console.log("Keeping", id);
}
const external = !keep;
return external
}
}
}
}
})here is the documentation for the option: You can play with the if statement to choose which modules are treated as external and not part of the build. |
the build tools are usually capable of marking certain modules as external and will not include them in the build result. Here is an example I made with vitejs, including only german and english for the message bundles: