fgeierst / typo3-vite-demo

GNU General Public License v2.0
20 stars 5 forks source link

Add Vite backend integration #2

Closed fgeierst closed 2 years ago

fgeierst commented 2 years ago

https://vitejs.dev/guide/backend-integration.html

mandrasch commented 2 years ago

Hey, thanks for starting this! Just as optional side notes, don't know if helpful:

Maybe these third party packages could be a good reference since they use a PHP-centric approach with .php-config-files:

(The new official https://github.com/laravel/vite-plugin took another approach to tackle this by using a more NodeJS-centric approach. But this led to lengthy discussions regarding DDEV usage https://github.com/laravel/vite-plugin/issues/83. Personally I wouldn't recommend this approach ;-)))

Unfortunately I'm not a typo3 backend pro, but I'm happy to participate in testing! ✅ Subscribed.

fgeierst commented 2 years ago

https://github.com/fgeierst/typo3-vite-demo/blob/master/packages/typo3_vite_demo/Configuration/TypoScript/setup.typoscript#L167

TODO: Add vite scripts only in development mode. In production mode read the hashed js and css file paths from manifest.json See https://vitejs.dev/guide/backend-integration.html, Section 3.