norcalli/ractiveify

Ractiveify 1.5.5 not carrying Ractive as global when using multiple files

Closed this issue · 2 comments

I have a bundle file that loads a ract file, that ultimately includes another component ract file, once I'm out of the bundle, Ractive is no longer available. This does work in Ractive 0.6.1 and Ractiveify 1.5.4

Example can be found here:
https://gist.github.com/dkleehammer/648e82c50fdec960e4fa

As a side note, ractiveify.extensions is file extensions to match against in case you don't like .ract or .rtv (which could be made clearer), so ractiveify.extensions.push(ractive) does essentially nothing.

I'm not sure why it would have been able to do that before, but it shouldn't have been. The problem is easily solved by just doing var Ractive = require("ractive") inside the script block in base.ract.

Great, thanks for clarifying that for me. My understanding was that the entire code set would've been wrapped in a browserify function that would use the bundle file as the outer function, any variable set in this level that was not overwritten by child functions would still be available.