Skip to content

Use resolve() to find which ractive.js to require #4

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JonDum
Copy link

@JonDum JonDum commented Jun 23, 2016

This solves two issues.

  1. If you have ractive installed globally with npm i -g, ractive-loader will pick up on that and use it and it may be the wrong version/patch of ractive (took me a long time to figure that one out sadly :( ).

  2. This removes the dependency of Ractive having to be in your node_modules folder by adding support for resolve.alias and for resolve.moduleDirectories. So now you can do something like:

        alias: {
            ractive$: process.cwd() + '/js/lib/ractive.js'
        },

And ractive-loader will pick up on that and require the correct ractive. This is important so that you have the same version of ractive being used to parse your templates as the version you are running. Since Edge and beta versions aren't on NPM, this makes it work for all cases.

@rstacruz
Copy link
Owner

oh gosh, sorry for ignoring this, totally forgot about this project... haha. nice catch, but we'll have to update those tests too.

  1) ractive-loader a simple template "before each" hook:
     TypeError: Object #<Object> has no method 'async'

It might have to be stubbed in this manner:

https://github.com/rstacruz/ractive-loader/blob/master/test/test.js#L11-L13

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

Successfully merging this pull request may close these issues.

2 participants