laravel-mix-react-typescript-extension icon indicating copy to clipboard operation
laravel-mix-react-typescript-extension copied to clipboard

vendor.js output path is 'public' instead of 'public/js'

Open balaccord opened this issue 4 years ago • 2 comments

Hi

vendor.js output path is wrong when the .extract() is applied

My setup:

npm run dev:

2020-06-01_102744

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')

balaccord avatar Jun 01 '20 06:06 balaccord

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();

manuelmaceira avatar Jun 04 '20 18:06 manuelmaceira

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 :)

balaccord avatar Jun 04 '20 22:06 balaccord