Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js + custom js path + mix.extract and mix.version - missing manifest.js #224

Closed
FDiskas opened this issue Jan 29, 2017 · 3 comments
Closed

Comments

@FDiskas
Copy link

FDiskas commented Jan 29, 2017

"name": "laravel-mix",
"version": "0.5.16"

Missing manifest.js and vendros.js files. But if they exists they must not be cash busted.
To reproduce this bug:
Add one more mix.js after .extract()
Probably extract should work only on files there was compiled before the extract() function.
If I put mix.extract() after all js files - the last directory was used public/modules/admin/js. It should be always in the same public js root folder.

webpack.mix.js

mix
  .js('resources/assets/js/app.js', 'public/js')
  .extract(['jquery', 'vue', 'lodash'])
  .js('Modules/Admin/Resources/assets/js/admin.js', 'public/modules/admin/js')
  .sass('resources/assets/sass/app.scss', 'public/css')
  .sourceMaps()
  .version()
;

generated mix-manifest.json

{
  "/js/app.js": "/js/app.62acfad02dae0ca7b6ac.js",
  "/css/app.css": "/css/app.105d2683ae1da59635b4.css",
  "/js/app.js.map": "/js/app.62acfad02dae0ca7b6ac.js.map",
  "/css/app.css.map": "/css/app.105d2683ae1da59635b4.css.map",
  "/modules/admin/js/admin.js": "/modules/admin/js/admin.65d9a742dd40e6c92d09.js",
  "/modules/admin/js/admin.js.map": "/modules/admin/js/admin.65d9a742dd40e6c92d09.js.map"
}
@JeffreyWay
Copy link
Collaborator

JeffreyWay commented Jan 30, 2017

@FDiskas Good catch. Yeah, I always assumed that folks would call mix.extract() after all mix.js() references. I've fixed that just now.

One important note, though, is that the vendor.js and manifest.js files will be placed in the output base directory of the last mix.js() call. So if you want them to be in the public/js/folder, do this:

mix
  .js('Modules/Admin/Resources/assets/js/admin.js', 'public/modules/admin/js')
  .js('resources/assets/js/app.js', 'public/js')
  .extract(['jquery', 'vue', 'lodash'])
  .sass('resources/assets/sass/app.scss', 'public/css')
  .sourceMaps()
  .version()
;

@FDiskas
Copy link
Author

FDiskas commented Jan 30, 2017

Thanks for the fix

@ardasatata
Copy link

I can confirm this issue still persist in version 6

"laravel-mix": "^6.0.49"

I created a placeholder file that points 'public/js/' as its output instead to solve this issue
here's my webpack.mix.js

mix.ts('resources/assets/js/_placeholder_.tsx', 'public/js/_placeholder_.js').react();
mix.extract();

hence you can find vendor.js & manifest.js files in the `/public/js/' directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants