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
config : For getting requirejs.config({path:{},shim:{}}) settings as a require.
Documentation
Basic usage
Put the plugins inside the baseUrl folder (usually same folder as the main.js
file) or create an alias to the plugin location:
main.js
requirejs.config({baseUrl:'/js',paths : {//create alias to plugins (not needed if plugins are on the baseUrl)config: '../bower_components/requirejs-plugin-config/config'}});// use plugin define(['config!*','config!paths'],function(config,config1){config={baseUrl:'/js',paths : {config: '../bower_components/requirejs-plugin-config/config'}}config1={config: '../bower_components/requirejs-plugin-config/config'}});
Removing plugin code after build
r.js
nowadays have the stubModules setting which can be used to remove the whole
plugin code:
({// will remove whole source code of "json" and "text" plugins during build// JSON/text files that are bundled during build will still work fine but// you won't be able to load JSON/text files dynamically after buildstubModules : ['json','text','requirejs-plugin-config']})