javascript - RequireJS: Set path to 'ignore' -


i'm using third-party library (through bower) declares dependency not want (it's styling). possible set dependency 'ignore,' or such value?

e.g.:

define(['jquery','dep_i_dont_want'], function(){...}); 

in require config:

paths: {     'jquery': 'path/to/jquery',     'dep_i_dont_want': 'ignore' } 

i require 'dep_i_dont_want', see ignored, , move on without including or failing. possible? not want edit third-party js file.

for context, doesn't seem possible in 'paths' object: none of undefined, null, '', 'ignore', 'blank', etc. seem work.

i suppose point dummy module, feels cheating.

i suppose point dummy module, feels cheating.

yes, have do. there no way tell requirejs "ignore module". (there's empty: scheme can give r.js modules loaded cdns that's r.js' use during optimization.)

what can rather setting path sort of empty module add before call require.config:

define('dep_i_dont_want'); 

this define module in such way if required somewhere, value undefined.


Comments