0

I am building a fullstack app using laravel and vue. I want to integrate quasar as a front end framework. I am using laravel mix to build the assets. I was wondering how I could tree shake quasar using laravel mix or webpack. The documentation just talk about vue-cli and quasar-cli tree shaking capabilities.

I tried following the import way of vue-cli with no success

1 Answers1

0

We use just as you described by running

In quasar repo:

quasar clean

quasar build

In API repo:

npm run production

In webpack.mix.js add like

mix.copy('/path/to/quasar/build/dist', 'public') (either SPA or PWA ?? Not sure what you're using)

Note: 'dist' folder will be folder that will contain 'index.html'...so sort of depends if you're building SPA, PWA... etc

One caveat worth mentioning: Depending on your production server (we use nginx) and it will cache the webpack chunks...so...if you get MIME/TYPE errors, clear out nginx cache and you should be good to go

hbmaddog
  • 64
  • 6
  • I see, you use laravel and quasar separately and just copy the build result of Quasar to the Laravel Project. I thought of using that way but I was wondering if it was possible to install Quasar using npm in the laravel project and still use tree shaking – Lawliet Darujin Jun 16 '19 at 00:39
  • We use Laravel for the backend API and quasar for the frontend. In web.php need to point to the quasar index.html file...all depends on how you want it set up... – hbmaddog Jun 17 '19 at 01:15