These are chat archives for brunch/brunch

Mar 2017
Mar 15 2017 02:12

Hi @DoumanAsh Thanks for your time, and sorry for my delayed response - My goal is this:

I have a series of resources (page, comment, user, etc.) and for each resource, I’d like to create a separate bundle - page-bundle.js, comment-bundle.js and user-bundle.js. I want, in every page to include just ONE of these bundles. For example, on a user page (registration/login/etc) I will include just user-bundle.js. Each bundle should contain vendor.js (jQuery, UI framework’s JS, Vue/React, etc.) and the rest of the JS meant for that resource, in this case, the user-related JS.

However, it seems to me that entryPoints are the right choice for this, as joinTo has a bug which prevents me from doing this (brunch/brunch#1610). However, when I use entryPoints, they’re not being generated at all, which brings me to the question - What exactly are entryPoints and how do they work? :D
Mar 15 2017 05:50
Hm... to be honest im not sure myself. Considering that entryPoints are supplement to joinTo i never used it at all. Maybe @shvaikalesh could help?
Meanwhile i wonder why you cannot go with joinTo ?
From your config it seems to be you should get all your files separately as you already have it in a separate folders
Mar 15 2017 09:04
@DoumanAsh As of the moment, I am using joinTo but it has its limitation - when included in an array, it doesn’t preserve the order inside the array. So, this means, your main code will load before Vendor.js and will lead to a slew of errors. So, currently my only work around is generate a separate vendor.js, include it in every page in a separate script tag and load page-specific scripts after. That’s two http requests and that sucks, but yeah, not many options. \