Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helpers from another repo (ie swag) #222

Open
kusmierz opened this issue Jan 12, 2015 · 0 comments
Open

Add helpers from another repo (ie swag) #222

kusmierz opened this issue Jan 12, 2015 · 0 comments

Comments

@kusmierz
Copy link
Contributor

I'm trying to integrate http://www.github.com/elving/swag with http://www.github.com/SlexAxton/require-handlebars-plugin. Swag will register their helpers using Handlebars.registerHelper method. It's all fine, unless you are trying to build it (r.js -o build.js). Builder can't see dynamic loaded helpers.

So I had to add to my build.js file:

({
    'name': 'app',
    //...
    'paths': {
        'templates/helpers/lowercase': 'empty:',
        'templates/helpers/uppercase': 'empty:',
        'templates/helpers/capitalizeFirst': 'empty:',
        'templates/helpers/capitalizeEach': 'empty:',
        'templates/helpers/titleize': 'empty:',
        'templates/helpers/sentence': 'empty:',
        'templates/helpers/reverse': 'empty:',
        'templates/helpers/truncate': 'empty:',
        'templates/helpers/center': 'empty:',
        'templates/helpers/newLineToBr': 'empty:',
        'templates/helpers/sanitize': 'empty:',
        'templates/helpers/first': 'empty:',
        'templates/helpers/withFirst': 'empty:',
        'templates/helpers/last': 'empty:',
        'templates/helpers/withLast': 'empty:',
        'templates/helpers/after': 'empty:',
        'templates/helpers/withAfter': 'empty:',
        'templates/helpers/before': 'empty:',
        'templates/helpers/withBefore': 'empty:',
        'templates/helpers/join': 'empty:',
        'templates/helpers/sort': 'empty:',
        'templates/helpers/withSort': 'empty:',
        'templates/helpers/length': 'empty:',
        'templates/helpers/lengthEqual': 'empty:',
        'templates/helpers/empty': 'empty:',
        'templates/helpers/any': 'empty:',
        'templates/helpers/inArray': 'empty:',
        'templates/helpers/eachIndex': 'empty:',
        'templates/helpers/eachProperty': 'empty:',
        'templates/helpers/add': 'empty:',
        'templates/helpers/subtract': 'empty:',
        'templates/helpers/divide': 'empty:',
        'templates/helpers/multiply': 'empty:',
        'templates/helpers/floor': 'empty:',
        'templates/helpers/ceil': 'empty:',
        'templates/helpers/round': 'empty:',
        'templates/helpers/toFixed': 'empty:',
        'templates/helpers/toPrecision': 'empty:',
        'templates/helpers/toExponential': 'empty:',
        'templates/helpers/toInt': 'empty:',
        'templates/helpers/toFloat': 'empty:',
        'templates/helpers/digitGrouping': 'empty:',
        'templates/helpers/is': 'empty:',
        'templates/helpers/isnt': 'empty:',
        'templates/helpers/gt': 'empty:',
        'templates/helpers/gte': 'empty:',
        'templates/helpers/lt': 'empty:',
        'templates/helpers/lte': 'empty:',
        'templates/helpers/or': 'empty:',
        'templates/helpers/and': 'empty:',
        'templates/helpers/formatDate': 'empty:',
        'templates/helpers/now': 'empty:',
        'templates/helpers/timeago': 'empty:',
        'templates/helpers/inflect': 'empty:',
        'templates/helpers/ordinalize': 'empty:',
        'templates/helpers/ul': 'empty:',
        'templates/helpers/ol': 'empty:',
        'templates/helpers/br': 'empty:',
        'templates/helpers/log': 'empty:',
        'templates/helpers/debug': 'empty:',
        'templates/helpers/default': 'empty:',
    }
})

Now it works fine, but I don't know it it's the best idea to do like this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant