ariatemplates / hashspace

JavaScript client-side template engine
http://hashspace.ariatemplates.com
Apache License 2.0
14 stars 18 forks source link

Browserify again #315

Closed piuccio closed 7 years ago

piuccio commented 9 years ago

I recently tried again to use hashspace with browserify and I noticed that the browserify build is broken, because of the update of grunt-browserify. There are also some changes in hashspace that makes the old configuration wrong.

So here is another attempt to use hashspace with browserify. This is how you use it inside the browser

<!DOCTYPE html>
<html>
    <head>
        <title>HashSpace</title>
    </head>
    <body>
        <div id="banana"></div>

        <script src="dist/hashspace-browserify.js"></script>
        <script src="dist/hashspace-browserify-compiler.js"></script>
        <script>
            var template = hspcompile(function () {/*
                <template banana(name)>
                    Hello {name}!
                </template>
            */});

            template.banana("Fabio").render("banana");
        </script>
    </body>
</html>

Now I don't really expect this PR to be merged, it's more a conversation starter. I see that there's a strong traction for using noder and the two approaches can be hardly maintained together.

@benouat You'll be glad to know that with this PR browserify generates UMD code, so maybe #3 gets fixed.