AMD-cache icon indicating copy to clipboard operation
AMD-cache copied to clipboard

How can I use this component in `require.config`?

Open MichaelGong opened this issue 10 years ago • 1 comments

How can I use this component in require.config? My config is like this:

require.config({
    baseUrl: '../libs/',
    paths: {
        api: ['api'],
        jquery: ['jquery.min'],
        zepto: ['zepto.min'],
                cache:['cache']
     }
});

I want to cache api jquery zepto,how can i do that?

MichaelGong avatar Nov 16 '15 09:11 MichaelGong

@MichaelGong You don't define caching in the config; you have to do it in the respective require call. An example based on your config:

require(['cache!api'], function(api){
  api.doSomething();
});

jensarps avatar Jan 04 '16 11:01 jensarps