Creating Multiple Bundles
See original GitHub issueIs it possible to create multiple bundles same time? So my plan is separating frontend assets from backend assets.
Example
Frontend
laravel([
'resources/css/frontend/app.css',
'resources/js/frontend /app.js',
]),
Backend
laravel([
'resources/css/backend/app.css',
'resources/js/backend /app.js',
]),
Thank you!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Multiple bundles with webpack - Stack Overflow
js file to the src directory, we need to make a change to the file webpack.config.js , which I don't like. Is there...
Read more >Webpack: Creating multiple bundles using entry points
A guide on creating optimizing a mult-page site using Webpack with multiple entry points.
Read more >Code Splitting - webpack
This feature allows you to split your code into various bundles which can then be loaded on demand or in parallel. It can...
Read more >Building Applications with Multiple Bundles - Apple Developer
Explains how Cocoa applications can dynamically load code during execution.
Read more >multiple-bundles-webpack-plugin - npm
Create multiple bundles from independent js/scss components. ... This plugin prevents Webpack 4 from creating an separate output file from ...
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 Free
Top 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
@garbinmarcelo Unfortunately I couldn’t find any solution. I am keeping webpack with mix.
Hello, this is not the official package and everything indicates that it will be discontinued.
I managed to do it the following way, I created 2 files:
vite.config.js
vite.painel.config.js
(in my case this is the admin)package.json
In my admin blade layout I use the following:
@vite(['resources/painel/app.scss', 'resources/painel/app.js'])
To set the correct panel build folder I define it in the provider boot, for example:
Posts that helped me reach this result: https://github.com/innocenzi/laravel-vite/discussions/324#discussioncomment-4135369 https://github.com/laravel/docs/pull/8146#issuecomment-1315986922
The “useBuildDirectory” can be invoked in several ways as explained in the post, linked above.
Hope I helped in some way.