You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the config has been created to be re-used at runtime as well as under nodejs, it does not seem to be picking it up from mainConfigFile if the format is 'unusual', i.e. not the standard require.config({});
for instance, when this failed to set a config:
(function(){varconfig={baseUrl: 'foo',..};// simplified umd-like wrap that sets config or preps it for later requirejs useif(this.require&&this.require.config)this.require.config(config);elseif(typeofmodule!=='undefined'&&module.exports)module.exports=config;elsethis.require=config;}.call(this));
... I tried the less ambitious:
varconfig={ ... };require.config(config);
which also fails. so the parse.getRequireObjectLiteral may also be at fault here.
I can have a go at fixing this outside of work hours if it's not something that can be worked around or easily fixed.
context: work out a flexible config reuse pattern between multiple pages, components and apps, sharing it for runtime/build and tests, in the style of patterns discussed here: requirejs/requirejs#354
The text was updated successfully, but these errors were encountered:
There are no plans to get fancier with the config detection, since it would then mean effectively simulating running code to find out what the config would end up being (at least the expectation would continue to grow over time for that).
The best thing to do is to construct a node program for your project that reads in that file, does a regexp or some other parse to extract that config object literal, evaluate it, then use that to construct build config args to pass to require('requirejs').optimize()](http://requirejs.org/docs/node.html#optimizer).
There may be a slight problem with this:
https://github.com/jrburke/r.js/blob/master/dist/r.js#L23147
When the config has been created to be re-used at runtime as well as under nodejs, it does not seem to be picking it up from
mainConfigFile
if the format is 'unusual', i.e. not the standardrequire.config({});
for instance, when this failed to set a config:
... I tried the less ambitious:
which also fails. so the
parse.getRequireObjectLiteral
may also be at fault here.I can have a go at fixing this outside of work hours if it's not something that can be worked around or easily fixed.
context: work out a flexible config reuse pattern between multiple pages, components and apps, sharing it for runtime/build and tests, in the style of patterns discussed here: requirejs/requirejs#354
The text was updated successfully, but these errors were encountered: