Can't copy files to the right folder when setting a different public path.
See original GitHub issue- Laravel Mix Version: 1.5.0
- Node Version (
node -v
): 8.1.2 - NPM Version (
npm -v
): 5.5.1 - OS: MacOS High Sierra
Description:
The company I work for has a styleguide folder in which they compile all of the necessary files. It is in raw gulp still and I want to convert it to laravel mix because the API is so much more fluent. The problem I’m facing is this: I have to convert a file and put it in the public folder (which works great), but then I have to copy that file to the styleguide folder for some sort of local documentation we have. So I’ve made this:
styleguide
- src
- dist
public
- js
- css
I’ve used the setPublicPath function to set the mix public path to ../
(the root of the project, since mix is in the styleguide folder). when I compile to the public/js/app.min.js
it works, but then when I try to copy this file to the styleguide/dist/js/app.min.js
that’s where it gets weird to me… It just makes a folder called dist
in the root and ignores the styleguide folder.
Steps to reproduce:
create a folder called styleguide
, install mix in that folder, create a folder called src
and put all of the files you want to compile in there. then run mix with a config like this:
mix.setPublicPath('../');
mix.js([
'node_modules/vue/dist/vue.js',
'src/assets/toolkit/scripts/app.js'
], 'public/js/app.min.js')
.copy('public/js/app.min.js', 'styleguide/dist/js/app.min.js');
Is this a bug or am I just doing something wrong?
- Luuk
Issue Analytics
- State:
- Created 6 years ago
- Comments:8
@sajaddp hey, no I just restructured my folder haha.
Now a few days later and I have tried some things but haven’t got it to work, I still don’t know if I’m just doing something wrong or something with the path’s is messed up… anybody had this problem and knows how to fix it? I’ll look in the source tonight aswell.