Lazy loading Stimulsoft in React +Vite
Posted: Wed Feb 11, 2026 10:16 am
Hi
it is possible to lazy loading Stimulsoft in React + Vite?
In vite.convig I've created a separate js chunk for Stimulsoft:
I call load only on a button click,not import it up in the component
but aways I see the js package(https://mysite.com/assets/stimulsoft-BD2YVTVO.js) in netwok tab every time I start my app
thanks
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