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.

Generate manifest for each javascript

See original GitHub issue

I have the following webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js').extract(
    ['foundation-sites', 'jquery', './resources/assets/js/laravel.js'], 'public/js/vendor.js'
);
mix.sass('resources/assets/sass/app.scss', 'public/css');

mix.js('resources/assets/admin/js/app.js', 'public/admin/js').extract(
    ['bootstrap-less', 'jquery', './resources/assets/admin/js/laravel.js'], 'public/admin/js/vendor.js'
);

This does work fine, however only one manifest is generated for admin javascript. This causes issues as I want to have a manifest for each mixed javascript to properly reference them in Blade using mix('path')

Output:

                                /js/app.f5a95ef2399c6a36eae4.js    1.08 MB    0, 4  [emitted]  [big]  /js/app
                                    /admin/js/app.69d60a6a37568b8adc3a.js     879 kB    1, 4  [emitted]  [big]  /admin/js/app
                                 /admin/js/vendor.0ccb9485f3e36472e423.js     337 kB    2, 4  [emitted]  [big]  /admin/js/vendor
                                       /js/vendor.d928eb65fcaa6bc93bbd.js     329 kB    3, 4  [emitted]  [big]  /js/vendor
                               \admin\js\manifest.d41d8cd98f00b204e980.js    5.68 kB       4  [emitted]         \admin\js\manifest
                                        /css/app.a3294d13b651cbe42440.css    1.33 MB    0, 4  [emitted]  [big]  /js/app
                                  /admin/css/app.a3294d13b651cbe42440.css     670 kB    0, 4  [emitted]  [big]  /js/app

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
moyveracommented, May 2, 2017

@henry-spanka did you find some solution ?? @arcanedev-maroc I see your current configuration leaving all the code in one directory, but did you find how to separate the code in directories with the right generation of the manifest ???

@JeffreyWay when you say that we only need one manifest.js…

what’s the way we need to organize our directories ??

I tried… copy the manifest.js file, include the manifest.js but I get the next error

manifest.js:53 Uncaught TypeError: Cannot read property 'call' of undefined
    at __webpack_require__ (manifest.js:53)
    at Object.module.exports.nativeSplit (vendor.js:10916)
    at __webpack_require__ (manifest.js:53)
    at Object.<anonymous> (vendor.js:646)
    at __webpack_require__ (manifest.js:53)
    at Object.<anonymous> (vendor.js:13053)
    at __webpack_require__ (manifest.js:53)
    at webpackJsonpCallback (manifest.js:24)
    at vendor.js:1
1reaction
arcanedev-maroccommented, Feb 4, 2017

Related: #224

And this is my repo if you want to reproduce the issue: https://github.com/ARCANESOFT/ARCANESOFT/blob/8560d5847215bb68260b49f2a1de7d801f78249b/webpack.mix.js

UPDATE

This is my last commit and everything works for the time being.

I hope this helps anyone that have the same issue: https://github.com/ARCANESOFT/ARCANESOFT/blob/4688a7aac5e2b2272ba8679a1b85d5722a064bdb/webpack.mix.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generate manifest for each javascript · Issue #250 - GitHub
I have the following webpack.mix.js: mix.js('resources/assets/js/app.js', 'public/js').extract( ['foundation-sites', 'jquery', '.
Read more >
How can I create a single Webpack manifest that includes ...
For rendering on the server I'm using webpack-manifest-plugin to generate a manifest for each build. // webpack.config.js const client ...
Read more >
Add a web app manifest
The web app manifest is a simple JSON file that tells the browser about your web application and how it should behave when...
Read more >
Create a PWA App Manifest Dynamically | by Kevin Basset
Every Progressive Web App has an app manifest, a simple JSON file that ... To generate your app manifest dynamically, you have two...
Read more >
The Manifest - webpack
Its main purpose is to bundle JavaScript files for usage in a browser, ... The runtime, along with the manifest data, is all...
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