I have a problem with r.js working the way we need.
I have the following problem: we have 2 domains (e.g. foo.de and bar.de) and different environments. Depending on which environment and domain they are working in, you need to download another file from the source servers. My initial solution was the following:
// channelDomain and environmentPath get defined above this script require.config({ paths: { 'fooscript': channelDomain+environmentPath } }
Testing this in an unoptimized browser works exactly as it should , but the nightly build complained:
[Error: Error: The config in mainConfigFile /absolute/path/app/public/js/main.js cannot be used because it cannot be evaluated correctly while running in the optimizer. Try only using a config that is also valid JSON, or do not use mainConfigFile and instead copy the config values needed into a build file or command line arguments given to the optimizer. Source error from parsing: /absolute/path/app/public/js/main.js: ReferenceError: channelDomain is not defined
I tried to do many things, but my ideas are running out. I tried to make it empty: a thing in the build file, but that didn't work either. I would be glad if someone could point me in the right direction.
source share