-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Require.js Support - BaseURL and Configuration #291
Comments
+1 |
So I think the best will be just not touch the baseUrl at all and let users do it. It means people need to understand that Testacular serves files under Here it is vojtajina/testacular@63f3f40 What do you think ? |
Beautiful, I think its much better to leave this in the hands of the consumer. And no worries, the code is straightforward enough I've just been using my patched adapter since I filed the bug. :-) |
One major problem with the current Require.js adapter is that it enforces you to call
requirejs.config
to configure the baseURL. This is unfortunate because Require.js allows you set up a global object called require which it will than read in as configuration. This is a much more flexible way of configuring your loader as it allows you to do overrides for different environments.Say I have a config.js file that I include in my HTML above the require.js file.
When Require.js gets loaded onto the page it will load in that require configuration, this allows me to override configuration options for my testing environment.
The problem is that the Require adapter calls:
Which unfortunately overrides whatever baseUrl someone might have configured. This also doesn't account for multiple require.js contexts. See Squire.js for an example of cloning require configuration.
One idea for a workaround is to concatenate the existing baseUrl onto '/base' though like I said this doesn't support multiple contexts very well... Perhaps we should implement testacular to prepend '/base' to all the existing configured baseUrls consequently supporting multiple contexts and require configuration.
Thoughts?
The text was updated successfully, but these errors were encountered: