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 uses absolute path to load the require.js script #36

Closed
louismrose opened this issue Aug 6, 2013 · 5 comments
Closed

Template uses absolute path to load the require.js script #36

louismrose opened this issue Aug 6, 2013 · 5 comments

Comments

@louismrose
Copy link

Hi,

Thanks so much for this template, which has saved me masses of time in getting our app ported over to Grunt!

I've noticed what I think might be a slight issues with the template that generates the Jasmine spec runner. It seems that the generated script tag for require.js always uses the absolute path, rather than the relative path, to the ".grunt" folder. More specifically, line 11 of the template (<script src="<%= temp %>/require.js"></script>) generates <script src=".grunt/grunt-contrib-jasmine/require.js"></script>

Curiously, the script tags that reference other files in the .grunt directory do not have this issue. For my setup they generate the correct relative path, such as <script src="../.grunt/grunt-contrib-jasmine/jasmine.js"></script>

I've taken a quick look at the grunt-contrib-jasmine project, and it seems to provide a function called getRelativeFileList that might be used to solve this issue. I don't feel that I know enough about the internals of either project to provide a patch, but would be happy to do so if somebody could provide a little bit of direction -- is this the right approach? And how would we access the getRelativeFileList function in the template provide by grunt-template-jasmine-requirejs?

Thanks for any help!

Cheers,
Louis.

@louismrose
Copy link
Author

For anyone else who faces this issue, I should mention that I'm using a symlink task in Grunt to workaround this for now: I add a symlink to the .grunt directory from the directory to which my spec runner is generated.

@plumlee
Copy link

plumlee commented Oct 15, 2013

I used a grunt-contrib-copy task to work around this. I modified the template file, stored it out of the node_modules directory, and as part of my unit test grunt task I copy it over the original each time. Symlinks weren't an option for me as we're both *nix and Windows.

@gilluminate
Copy link

Thanks for the symlink idea.

@gilluminate
Copy link

I just submitted pull request #45 which would allow the user to set requireFile as a template option as a path relative to the outfile (_SpecRunner.html)

@cloudchen
Copy link
Owner

Fixed in v0.1.10

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

4 participants