change laravel mix extracted file path

Viewed 606

I have a laravel application and on that config the laravel mix like below

const mix = require('laravel-mix');

mix.react('resources/assets/js/app.js', 'public/assets/js')
   .react('resources/assets/js/pages/treatments_pricing.jsx', 'public/assets/js/admin')
   .react('resources/assets/js/admin.js', 'public/assets/js')
   .react('resources/assets/js/pages/channels.jsx', 'public/assets/js/admin')
   .react('resources/assets/js/pages/faq.jsx', 'public/assets/js/admin')
   .react('resources/assets/js/pages/threads.jsx', 'public/assets/js/admin')
   .js('resources/assets/js/component.js', 'public/assets/js/admin')
   .extract(['vue', 'jquery', 'bootstrap', 'react', 'axios']);

by default in documentation laravel said that the extract file path is js/manifest.js and js/vendor.js I need to extract them to the assets/js/manifest.js and assets/js/vendor.js

but after compile the assets I can see laravel mix put the vendor.js and manifest.js to the assets/js/admin/vendor.js and assets/js/manifest.js.

how could it be happend?

and how should I change the path to the assets/js

1 Answers

Not sure if you solved this yet but did you try mix.setPublicPath('./assets/')

I would also set that above your mix.js or mix.reacrt calls.

Related