question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
luukhoebencommented, Oct 23, 2019

@sajaddp hey, no I just restructured my folder haha.

1reaction
luukhoebencommented, Oct 23, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't copy files to the right folder when setting a ... - GitHub
I've used the setPublicPath function to set the mix public path to ../ (the root of the project, since mix is in the...
Read more >
Can't copy files from mapped drive to local directory
This article solves the Location is not available error when you try to copy files from a mapped drive. Applies to: Windows Server...
Read more >
Unable to copy file - access to the path is denied
First go to location of the file. Then right click on the folder of the file -> Properties -> Unchecked Read Only Option...
Read more >
SOLVED: How to Move PUBLIC Folder In Windows 10
Go to c:\USERS · Right click on PUBLIC and select SECURITY · Click ADVANCED · Click CHANGE on OWNER and set it to...
Read more >
Access Denied When Copying Files Windows 10/8/7 - EaseUS
Part 1: What Causes This Access Denied Error · Folder ownership has changed. · You do not have the appropriate permissions. · The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found