Output files outside of the public path directory
See original GitHub issue- Laravel Mix Version: 1.2.0
- Node Version: 8.1.2
- NPM Version: 5.0.4
- OS: LMDE 2 Betsy
Description:
I have posted this issue before but was pretty much disregarded and closed. I don’t think it was understood what I was trying to achieve. I have a repository this time so that you can see exactly what I am trying to do.
I am trying to mix a file and output the resulting file outside of my public path. In a Laravel project am I taking a file from resources/assets/js/app.js
and trying to output it to resources/assets/js/app2.js
and in the same file grab a sass file from resources
and output the result of mix.sass()
to the public
folder. So I am trying to output files to two different directories in the same mix file like you could do with Laravel Elixir. See the repo for a live example. I want the mix-manifest.json
to go inside the public
folder so setting the project root as the public path is not what I want.
My current workaround is having two mix files for outputting to resources
and public
respectively. Another workaround would be having the project root as the public path and then after compiling the assets, moving the mix-manifest.json
to the public
folder but then the directories would be pointing to stuff inside the resources folder which is not what I want either.
Steps To Reproduce:
A live example is available at this repository.
This issue is a duplicate of #951 but this is more in depth and hopefully you will understand what I want to achieve.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:8
Top GitHub Comments
According to my Laravel project structure:
I’ve successfully configured the laravel-mix using the following code:
The code that I found to work the best for this in 5.5 is:
This puts the mix-manifest.json in the html root.
Hope this helps.