Laravel-mix: Absolute paths in compiled JS-files since v4 - Question

Created on 18 Jan 2019  Â·  9Comments  Â·  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 4.0.14
  • Node Version: 10.13.0
  • NPM Version: 6.5.0
  • OS: macOS 10.14.2

Description:

Hi! I think this is more a question than an issue ¯_(ツ)_/¯
In our Laravel Application we are compiling multiple JS/SASS Files into multiple Files, so we can load only the necessary file on each page.
We've updated from Laravel Mix v2 to v4. Since then, there are absolute paths (as a comment) in the compiled JS Files like this:

/*!**************************************************!*\
  !*** multi ./resources/assets/admin/js/admin.js ***!
  \**************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(/*! /Users/absolute/path/resources/assets/admin/js/admin.js */"./resources/assets/admin/js/admin.js");


/***/ })

We are working in a team and this is a little bit confusing, because the compiled files are in our repo too - we have a very simple deployment - Github -> Envoyer -> Server (no compiling).

Anyone knows a work-around for this?
I guess this is a webpack thing?
I've searched the whole last evening but didn't find something useful.

Steps To Reproduce:

Install Laravel, run npm run dev and take a look into public/js/app.js (to the bottom lines of the file).

Most helpful comment

I'm not sure there's much if anything we can do to change this but I'll try looking into it when I hopefully get some time to do so in the coming weeks.

All 9 comments

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.

Am interested to know if there is a way to remove that path as well. If someone on my team pulls down my changes and compiles the assets using npm run dev, all the files that get compiled get modified with that team members path even though the source file did not change (in my case we have a number of separate files that get outputted)

Having the same issue. Is there a way to remove the part under the comment, e.g. in this case:
module.exports = __webpack_require__(/*! /Users/absolute/path/resources/assets/admin/js/admin.js */"./resources/assets/admin/js/admin.js");

can it be compiled without the:
/*! /Users/absolute/path/resources/assets/admin/js/admin.js */

Hey @maxxscho or @daylightstudio did you find a solution for this? It's really annoying, I constantly have to deal with conflicts

@j3ca no, I have no solution. I guess, I have to live with this. But because I am using Tower as my Git Client the conflicts are easy to resolve.
I am not sure, if this is a problem of Laravel Mix at all or something webpack related. ¯_(ツ)_/¯

@j3ca, I'm in a similar boat as @maxxscho. I have not found a solution and am using Tower to resolve any conflicts.

I'm experiencing the same issue.

Any news on how to fix this? It’s really annoying:/

I'm not sure there's much if anything we can do to change this but I'll try looking into it when I hopefully get some time to do so in the coming weeks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Micaso picture Micaso  Â·  3Comments

jpmurray picture jpmurray  Â·  3Comments

Cheddam picture Cheddam  Â·  3Comments

wendt88 picture wendt88  Â·  3Comments

rderimay picture rderimay  Â·  3Comments