javascript - make requirejs ignore library -
i loading external dependency work amd module requires knows how many sub libraries not on path configured config.
is there way tell requirejs not load library module , instead let me include normal script tag.
example:
library.js:
if (typeof define === "function) { // or how ever optional define stuff // amd stuff } else { // set globally }
normally requirejs see if loaded script tag , freak out how read. want requirejs ignore , let set globally not have worry libraries depends on.
currently doing setting define undefined before call script set after call script. seemed fix it...
it sounds want bundled version of lib including. if lib doesn't have bundled js file available, can create own using browserify.
browserify some-library.js -o bundled-some-library.js
as long have dependencies installed @ time bundle lib, give single file can use script tag src.
Comments
Post a Comment