laravel-mix-react-typescript-extension
laravel-mix-react-typescript-extension copied to clipboard
vendor.js output path is 'public' instead of 'public/js'
Hi
vendor.js output path is wrong when the .extract() is applied
My setup:
- [email protected]
- [email protected]
- node v14.2.0
- Windows
npm run dev:
Just the same config places the vendor.js to where it should be when the only method call is changed:
mix.reactTypeScript('resources/js/app-react.ts', 'public/js/app.js')
// or
// mix.js('resources/js/app.js', 'public/js/app.js')
// or
// mix.react('resources/js/app-react.js', 'public/js/app.js')
Had the same problem today, found a workaround adding a second argument to the extract function indicating the desired output path.
mix.sass('resources/sass/app.scss', 'public/css')
.reactTypeScript('resources/js/app.js', 'public/js') // in these we dont need the full path, laravel mix interprets it as "app.js"
.extract([...], 'public/js/vendor') // there is no need to add ".js" but we need to specify vendor, otherwise we'll get "js.js"
.version();
Had the same problem today, found a workaround adding a second argument to the extract function indicating the desired output path.
Oh, thanks! Your solution is much simpler than mine - the complete webpack.js written almost from scratch :)