它能够使用externals
来使用全局变量,但是可以像Code Splitting
功能一样延迟加载外部js文件吗?
You should use script loader https://github.com/ded/script.js
" Like many other script loaders, $script.js allows you to load script resources on-demand from any URL and not block other resources from loading (like CSS and images)."
var $script = require("scriptjs");
$script("//ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js", function() {
// ...
});
I've written a loader that allows you to expose modules from one webpack build to others via a global defined namespace, this lets you define which modules you want to share between the webpack builds and allows you to share common modules while maintaining the bundles intact.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.