Answer the question
In order to leave comments, you need to log in
How to apply webpack on an existing application?
Good afternoon!
I'm learning webpack and can't seem to figure out how to use it on an existing real php application. The application is not static with html pages, but generated by a framework or cms. I know that you can set several entry points for different pages and collect a bundle specific to them, but these points must be set as static .html (contacts.html, about.html etc.). It turns out that for each URL that exists in a real application, I have to create, as it were, its analogue in the form of static html and set it in the list of entry points. I didn’t understand something in this workflow at all, but I can’t catch what?
I have a url: site.com/user/xxx/profile/edit (conditionally). What is being done on this page, I think is clear. It turns out that in order to build a bundle for this url, I have to create something like edit-profile.html and work with it in webpack? For it, write all the necessary require and so on ... And already in the php application itself (in a specific view), connect Asset with the desired bundle, say EditProfileAsset. So does it work?
UPD: The further it goes, the more it seems that webpack is not suitable for my purposes. It is not integrated with Yii2 at all. There are some wrappers , you need to try, there is no native support.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question