The json plugin uses if (( config.isBuild && (config.inlineJSON === false || name.indexOf(CACHE_BUST_QUERY_PARAM +'=') !== -1)) || (url.indexOf('empty:') === 0)) {
when the optimiser runs so you have a couple of options.
- Add the build config option
inlineJSON: false
, - Add
!bust
to the end of the json require.require('json!/pagelang/login!bust')
, or - Add the path to the build config option
paths: { "/pagelang/login": "empty:" }
The text plugin uses if (config.isBuild && !config.inlineText) {
and if (url.indexOf('empty:') === 0) {
- Set the build config option
inlineText: false
, or - Add the path to the build config option
paths: { "/template/login": "empty:" }
=================================================================
Update: if you can't get the option inlineJSON
to work, try using inlineText
, which seems to cover JSON as well.
Reference: https://github.com/requirejs/r.js/blob/master/build/example.build.js