Shim from grunt-contrib-requirejs not wrapping library

蹲街弑〆低调 提交于 2019-12-05 10:01:37

It's just a wild guess (depending on your optimizer version) but the - not so cool - config-documentation states here:

As of 2.1.11, shimmed dependencies can be wrapped in a define() wrapper to help when intermediate dependencies are AMD have dependencies of their own. The canonical example is a project using Backbone, which depends on jQuery and Underscore. Shimmed dependencies that want Backbone available immediately will not see it in a build, since AMD compatible versions of Backbone will not execute the define() function until dependencies are ready. By wrapping those shimmed dependencies, this can be avoided, but it could introduce other errors if those shimmed dependencies use the global scope in weird ways, so it is not the default behavior to wrap.

so maybe use:

wrapShim: true

https://github.com/jrburke/r.js/blob/master/build/example.build.js

since your using "mainConfigFile" the shim config should already be in the optimizer, this is often another point of failure.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!