I want to use Vueify in my Laravel project. I have different Vuejs components using Vueify (*.vue files). My question is about how to best organize the required files and also optimize JS code sent to browsers.
Basically I would like to use such components directly in my blade template that includes my Vue instance. But since I need to compile that *.vue files, I cannot reference them directly in my template. With that, I mean doing stuff like:
import Timeline from "./components/Timeline.vue";
within my blade template is not working.
Thus I created a dedicated JS file for each blade template where I store the Vue object that includes the components. This doesn't feel right. For example it make my gulp file looks like:
mix.browserify('models.js', 'public/js/compiled-models.js');
mix.browserify('campaigns.js', 'public/js/compiled-campaigns.js');
mix.browserify('campaigns_edit.js', 'public/js/compiled-campaigns_edit.js');
mix.browserify('product.js', 'public/js/compiled-product.js');
...
I hope you know what I mean. I did it like that, because I was afraid of combining all components to a single app.js file. I did not find any information about what is the way to go here.
Basically I would love to get rid of all *.js files because they are just my way to get components compiled down. Or, at least I do not want to create one file per "page".
How to organize this?