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

Allow populating strings for module names in builds #324

Closed
jrburke opened this issue Nov 27, 2012 · 0 comments
Closed

Allow populating strings for module names in builds #324

jrburke opened this issue Nov 27, 2012 · 0 comments
Milestone

Comments

@jrburke
Copy link
Member

jrburke commented Nov 27, 2012

Now that 2.1.2 has a file cache, there are some dynamic build situations, particularly for web-based builders, where the string contents of a file could be auto-generated. Ideally these strings could be seeded into the file cache on each optimizer run.

Consider a build option that looks like this:

{
  rawText: {
    'some/module/id': 'string contents here'
  }
}

Then, in jslib/build.js, once config is set in the requirejs context, but before the first require() for modules happens, go through the rawText list, call require.toUrl to get urls for those IDs, and seed require._cachedRawText with the text values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant