作者:华浦即热式电热水龙头_376 | 来源:互联网 | 2022-12-24 18:43
我正在使用配置angularjs项目依赖 requirejs
以下是配置
"cornerstone-core":"emp/cornerstone.min",
"cornerstone-math":"emp/cornerstoneMath.min",
"hammer":"emp/hammer.min",
"properties":"emp/properties"
"clientParameters":"emp/clientParameters"
"cornerstone":"emp/cornerstone"
"cornerstoneMath":"emp/cornerstoneMath"
"cornerstoneTools":"emp/cornerstoneTools"
"cornerstoneWADOImageLoaderCodecs":"emp/cornerstoneWADOImageLoaderCodecs"
"cornerstoneWADOImageWebWorker":"emp/cornerstoneWADOImageWebWorker"
"myApp":"emp/myApp"
运行时依赖项是,
clientParameters : [ "properties" ],
cornerstoneMath : [ "properties", "clientParameters", "cornerstone-core", "cornerstone-math", "hammerjs" ]
cornerstone : [ "properties", "clientParameters", "cornerstone-core", "cornerstone-math", "hammerjs" ],
cornerstoneTools : [ "properties", "clientParameters", "cornerstone-core", "cornerstone-math", "hammerjs" ],
myApp : [ "properties", "clientParameters", "cornerstone", "cornerstoneMath", "cornerstone-core", "cornerstone-math", "hammerjs" ]
在cornerstone.js中,我按以下方式加载模块,
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define("cornerstone", [], factory); // error line
else if(typeof exports === 'object')
exports["cornerstone"] = factory();
else
root["cornerstone"] = factory();
})(this, function() {
return (function(modules) {
我收到以下错误,
myApp.js:2312 Uncaught(in promise) ReferenceError: cornerstone is not defined
在行define("cornerstone", [], factory);
当我与更换错误行root["cornerstone"] = factory();
一切工作正常.
[编辑]
工厂方法是在这个问题中使用的bootstrapper:试图理解Webpack