it is possible to lazy loading Stimulsoft in React + Vite?
In vite.convig I've created a separate js chunk for Stimulsoft:
Code: Select all
build: {
outDir: "../API/wwwroot",
modulePreload: {
polyfill: false,
resolveDependencies: (_filename, deps, _context) => {
return deps.filter(dep => !dep.includes('stimulsoft'));
}
},
rollupOptions: {
output: {
manualChunks: {
'stimulsoft': ['stimulsoft-reports-js-react/viewer'],
}
}
},
},I call load only on a button click,not import it up in the component
Code: Select all
onClick={async () => {
....
const { Stimulsoft } = await import('stimulsoft-reports-js-react/viewer');
..
thanks