Laravel mix outputs the compiled assets in wrong directory
See original GitHub issue- Laravel Mix Version: 6.0.43
- Node Version: v16.15.0
- NPM Version: 8.5.5
- OS: Windows 10
Description:
webpack.mix.js file:
const mix = require('laravel-mix');
mix.sass('resources/sass/auth.scss', 'resources/css').options({
processCssUrls: false
});
auth.scss file:
body {
background-color: #fff;
a, a:hover {
color: green;
}
}
The output of the auth.css
file should be resources/css/auth.css
. Instead it’s public/resources/css/auth.css
.
However, the mix-manifest.json
file outputs the corect path:
{
"/resources/css/auth.css": "/resources/css/auth.css"
}
Steps To Reproduce:
Check above.
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
node.js - Laravel-mix output path is outputting two different ...
mix file exists, so I had to do some changes first: Inside 'node_modules/laravel-mix/src/Paths. js' I changed the mix() function like this:
Read more >Mix compiling assets to the wrong directory after modifying the ...
I have modified the paths in the index.php file and the app works as intended now. The problem arises when I try to...
Read more >Compiling Assets (Mix) - The PHP Framework For Web Artisans
If you've ever been confused and overwhelmed about getting started with webpack and asset compilation, you will love Laravel Mix.
Read more >Compiling Assets (Laravel Mix)
Русская документация Laravel 5.6 - Compiling Assets (Laravel Mix) ... own respective CSS files and even customize the output directory of the resulting...
Read more >The Mix API | Laravel Mix Documentation
You can customize the output of the extraction using the output param. ... Set the path to where all public assets should be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not just relative to the public path – it does absolutely everything, including chopping up paths and ignoring them entirely, to keep the output within the public path. Even something like
css/../../resources
is treated likepublic/resources
.This is an issue that has been reported many times here, never with an answer. It seems there is just no way to get Mix to interact with anything outside the public folder in any way, at all, ever, under any circumstances, except as an input path.
Going by earlier threads, it seems it used to be possible to copy or combine files outside the public path – but that’s no longer the case, so you can’t even copy a processed file to your resources folder anymore.
It is, plainly put, bewilderingly stupid. Of course the public folder should be the default output for processed assets; but saying that nothing processed can ever be placed anywhere but in the public folder under any circumstances is beyond opinionated, it’s plain wrong.
do you have any start kit for gulp? i am really want to use one but copying assets from node_modules to public folder…this has become my main issue, i can’t find a proper gulp package which can do that.
if you developed any starter-kit kind, please share.
thanks