laravel-mix / laravel-mix

The power of webpack, distilled for the rest of us.
MIT License
5.27k stars 808 forks source link

mix.version() adds 'public' to path and fails #1708

Closed DMeganoski closed 5 years ago

DMeganoski commented 6 years ago

Description:

mix.version() seems to be confusing paths to sass files for mapping. It is adding 'public' to the middle of the correct path to the scss file.

In my webpack.mix.js file (project root):

let combinedFile = __dirname + '/resources/assets/sass/combined.scss';

mix.combine(sassFiles, combinedFile);

mix.sass(combinedFile, 'public/css/app.css');

mix.version(['public/js/app.js', 'public/css/app.css']);

Results in: Error: ENOENT: no such file or directory, open 'E:\Projects\laravel-slab\public\resources\assets\sass\combined.scss'

Commenting out the version() seems to resolve the issue. But I would like to have the file versioned.

Steps To Reproduce:

I'm not sure how to reproduce this. I am combining the main sass file, and sass files from sub-directories (working on a modular cms). The paths in these sub-directory files are relative as if they were in the same folder as combined.scss However this seems unrelated, as it's not having an issue locating node packages, it's having an issue finding the file it literally just got done processing.

Any ideas what might be going on here?

levidurfee commented 6 years ago

I had the same problem!

Check out this comment on issue #1333. It worked for me :)

stale[bot] commented 5 years ago

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.