The new v0.8.3 outputs the compiled javascript relative to public folder. So if now I were to compile this code,
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
It will output the files to:
public/public/js/app.js
public/css/app.css
npm run devAs a quick fix, I believe the error lies in the webpack path for public/js which Jeffery is probably fixing as I type, just removing the public part seems to work:
mix.js('resources/assets/js/app.js', '/js')
.sass('resources/assets/sass/styles.scss', 'public/css');
I think this works as it should, probably because it now uses the publicPath variable.
If you look at the initialize function in the Mix.js:
if (this.isUsingLaravel()) this.publicPath = 'public';
I'm not sure if this is relevant but I thought it could be useful to tell you.
@weldricks yeah, forgot to point that out. Thanks 馃憤
I can't reproduce this. Can any of you do npm update laravel-mix to bump to 0.8.4, and then confirm that this is still an issue?
Can confirm in 0.8.4.
So if you do:
laravel new test && cd test
npm install
npm run dev
...you get public/public/js/app.js??
public/js/app.js 1.16 MB 0 [emitted] [big] public/js/app
/css/app.css 684 kB 0 [emitted] [big] public/js/app
Yep, the built js goes to public/public/js/app.js.
Windows or Mac? You're positive that you're on 0.84? Fresh install gives me:
https://www.dropbox.com/s/szrtzb71n112bxx/Screenshot%202017-02-23%2011.25.28.png?dl=0
Windows 10. It might be an OS-specific issue.
I can confirm this issue on a fresh laravel installation on Windows 10.
laravel/installer - 1.3.5
laravel-mix - 0.8.4
node - 6.10.0
npm - 4.2.0
I can confirm as well.

Okay, well it would be great if some of you Windows users could help out, and dig in to figure out what's happening here.
Maybe open this file and do a few console.logs() to figure out what the deal is. This is the file that builds up the Webpack entry points.
https://github.com/JeffreyWay/laravel-mix/blob/master/src/EntryBuilder.js#L40
The highlighted line in that file should remove the /public portion.
I added the following lines before this.entry.add().
console.log(paths);
console.log(this.entryName(paths.output));

@d3radicated Perfect. Can you go to that file, and change the entryName method to this?
entryName(output) {
return output.pathWithoutExt
.replace(/\\/g, '/');
.replace(this.mix.publicPath + '/', '/')
}
And then run it again. Does that fix it? I bet it does.
That solves it.

Wahoo! I've fixed and tagged it. npm update laravel-mix. Thanks for the help. :)
Hi @JeffreyWay ...
Finally a long Day and i came across this post.
Degrading from v1.0 to v 0.8 worked for me.
But can you let me know that what is the alternative for
Mix.output().path in laravel-mix v1.0 that comes with laravel v5.4.22
as I am facing issues in below code with v1.0 with Mix.Paths.root and Mix.output().path
let HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports.plugins.push(
new HtmlWebpackPlugin({
template: Mix.Paths.root('resources/views/index.html'),
inject: false
})
)
let PrerenderSpaPlugin = require('prerender-spa-plugin');
console.log(Mix.output().path);
module.exports.plugins.push(
new PrerenderSpaPlugin(
Mix.output().path,
[ '/' ]
)
)
Most helpful comment
Wahoo! I've fixed and tagged it.
npm update laravel-mix. Thanks for the help. :)