Generate manifest for each javascript
See original GitHub issueI 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:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
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