You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm not building SPAs, but a PHP application using Twig for the SSR views.
I have 50+ PHP modules i.e. Users, Orders, Products etc. and each of these modules have their own view/index.twig, their own assets like css, js etc.
Module/Orders/assets/js/index.js imports other Js utilities etc and I would like this to be bundled at public/assets/build/orders/js/index.ac4ksl63kd.js,
and the same pattern for other modules i.e. /public/assets/build/products/js/index.7hdskk32cv.js..
Currently when I do this via the Vite config these file are built at the destination, BUT these files are empty and thats apparently because of treeshaking or something because Rollupjs cannot understand where these "index.js" files are used, because I do not have html entry points, and I only supply those module index js files as entry points (not html files).
Please help me solve this - I previously used this method successfully with Webpack, but I need to move on to more modern methods.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I'm not building SPAs, but a PHP application using Twig for the SSR views.
I have 50+ PHP modules i.e. Users, Orders, Products etc. and each of these modules have their own view/index.twig, their own assets like css, js etc.
Module/Orders/assets/js/index.js imports other Js utilities etc and I would like this to be bundled at public/assets/build/orders/js/index.ac4ksl63kd.js,
and the same pattern for other modules i.e. /public/assets/build/products/js/index.7hdskk32cv.js..
Currently when I do this via the Vite config these file are built at the destination, BUT these files are empty and thats apparently because of treeshaking or something because Rollupjs cannot understand where these "index.js" files are used, because I do not have html entry points, and I only supply those module index js files as entry points (not html files).
Please help me solve this - I previously used this method successfully with Webpack, but I need to move on to more modern methods.
Beta Was this translation helpful? Give feedback.
All reactions