norcalli / ractiveify

Browserify transform for ractive components (and by extension templates) which allows for compilation of embedded scripts and styles!
9 stars 1 forks source link

Ractiveify 1.5.5 not carrying Ractive as global when using multiple files #6

Closed dkleehammer closed 9 years ago

dkleehammer commented 9 years ago

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

norcalli commented 9 years ago

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.

dkleehammer commented 9 years ago

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.