Closed bregenspan closed 11 years ago
Due to the above style (filename different from module name, but not set in paths config) not really being the recommended Require.js way, and apparently failing for some (but not all) modules included this way, I think for this particular use case another approach is needed besides what I did here -- probably dynamically generating paths config. So, please disregard -- closing this thread for now!
For a project I'm working on, I wanted to replace in require.js-formatted script tags, for example transforming:
to:
This isn't possible out-of-the-box because matching is done by full file basename, including extension. So I added optional ability to set the find and replace match formats to something distinct from the filename format in: https://github.com/bregenspan/grunt-hashres/commit/af8bf7986365860a91d94ffea0847733d2562329
Setting two extra format strings strikes me as a bit inelegant but I have yet to come up with a nicer approach for it.
@luismahou - is this the kind of feature you'd consider for core? If so I'll clean things up and add tests + do a pull request.
Thanks for the very useful module! -Ben