CommonJS noob here, I read about browning and thought it was easier than my existing RequireJS installation, so I went ahead and changed them. I found that I will have code duplication in each set. Let me explain:
Suppose I have page1.js and page2.js use jquery.js and jquery-ui.js
Now I need to create bundle1.js and bundle2.js , and the contents of jquery.js and jquery-ui.js will be duplicated in each set.
I tried to split into different files in the browser, only by linking jquery.js and jquery-ui.js , for example:
<script src="lib_bundle.js"> <script src="page1.js">
The problem is that require inside page1.js will not work because it is not a generic package.
source share