laravel-modules icon indicating copy to clipboard operation
laravel-modules copied to clipboard

vite configuration guide

Open wikigods opened this issue 3 years ago • 3 comments

Hello, a small guide for vite with the "nwidart/laravel-modules" package.

  1. edit package.json Screenshot_31
  2. Modules\User\Resources\assets\js\app.js add "import './bootstrap';".
  3. Modules\User\Resources\assets\js\bootstrap.js Screenshot_33
  4. Modules\User\Resources\assets\sass\app.scss (optional variables) Screenshot_36
  5. Modules\User\Resources\views\layouts\master.blade.php (I recommend that you make helper, for cleaner code :) ) Screenshot_37
  6. Modules\User\vite.config.js (I have found 4 ways, but this is the best example I think.), "Omit those in red box". Screenshot_38
  7. Modules\User\webpack.mix.js (Delete webpack.mix.js )
  8. Thank you for your attention, hoping you will accept the merge. https://github.com/nWidart/laravel-modules/pull/1455 @dcblogdev @kylecmccandless

wikigods avatar Sep 27 '22 00:09 wikigods

I assume your adding this bootstrap code here as a POC? Laravel has taken tailwind as its primary CSS framework and for compatibility I would suggest sticking with tailwind. Do you have a way to build all from the root vite file as to not have to run npm build in an undetermined number of modules? In a CI pipeline this would be a huge pain.

@wikigods @dcblogdev

kylecmccandless avatar Sep 27 '22 17:09 kylecmccandless

Cool @wikigods but why images ? not a plain text ? :D

tdrabikdev avatar Sep 29 '22 11:09 tdrabikdev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 14 '22 17:10 stale[bot]