I am experienced on PHP and Javascript and used them extensively up to now. I never used modern js frameworks like Vue, Angular or React and very new to this concept. And also have no experience with bundlers.
Now I want to try it and enter to the new world of modern web app development. I've started reading with Vue docs and liked it.
But I am not ready to develop a Single Page App from scratch. Instead I want to try it within an existing project (with PHP backend and ES6 frontend)
I've searched for such integrations but could not found any helping document.
I want to use:
- .vue SFC files
- Hot updates (HMR)
- Vite
More info:
The PHP framework I use have single index.php entry and virtual routing via htaccess.
Simple structure is like:
www/
├──.htaccess
├──index.php
├──Application/
├──public/
│ ├── js/
│ ├── css/
├──Modules/
│ ├──MyVueApp/
│ │ ├──Controllers/
│ │ ├──Views/
│ │ │ ├──index.phtml
│ │ ├──Model.php
│ │ ├── //and etc...
At location http://localhost/en/MyVueApp Backend framework renders a dynamic index page within a layout.
Contents of index.phtml
<?php
$this->layout->addCss('css/my-vue-app/main.css')
$this->layout->addJs('js/my-vue-app/main.js')
?>
<div id="app"><!-- vue app mounts here --></div>
How can I install and run Vite+Vue on this structure and how can I publish it for production ?