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

template files relative to requirejs baseUrl #647

Merged
merged 1 commit into from
Jan 13, 2014
Merged

template files relative to requirejs baseUrl #647

merged 1 commit into from
Jan 13, 2014

Conversation

stevenvachon
Copy link
Contributor

Adds support for relative URLs in templates loaded with RequireJS. Allows us to work with custom baseUrls in require.config(). For development environments only, but it's not necessary for production if using can-compile.

@justinbmeyer
Copy link
Contributor

This breaks the tests. Please fix and re-submit.

@stevenvachon
Copy link
Contributor Author

Yep, trying. I think I'm finding that RequireJS' almond does not support dynamic loading, so it does not have require.toUrl().

@stevenvachon
Copy link
Contributor Author

I'm not sure how to write a QUnit test for this because it needs to run in a dev environment with the full version of RequireJS (not almond). Is this currently possible?

@daffl
Copy link
Contributor

daffl commented Jan 11, 2014

Yes Travis and therefore grunt test are running tests on the standalone and AMD builds. You can run them in the browser by going to test/amd/index.html (which only works after running grunt build).

Your test just needs to be conditional:

if(window.require) {
  test('test baseUrl', function() {
    require.config({ baseUrl: 'bla/ });
    // Do tests here
  });
}

@stevenvachon
Copy link
Contributor Author

I am never using issue/PR numbers in a commit message ever again.

daffl added a commit that referenced this pull request Jan 13, 2014
template files relative to requirejs baseUrl
@daffl daffl merged commit e1a8d72 into canjs:master Jan 13, 2014
@stevenvachon stevenvachon deleted the patch-2 branch January 23, 2014 13:54
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.

None yet

3 participants