13
我使用的是服务于我的angular
应用程序中创建uibModal
如下严重依赖 - 依赖的请求是表达的WebPack
function modal(modalConfig){
var modalInstance = $uibModal.open({
animation: true,
template: require("../a/b/xyz.html"),
controller: modalConfig.controller,
size: modalConfig.size,
controllerAs: modalConfig.controllerAs,
bindToController : true,
resolve: modalConfig.resolveObj
});
}
请注意行
template: require("../a/b/xyz.html"),
我想在这样的地方使用变量
template: require(modalConfig.templateUrl),
但当我代替硬编码值使用变量webpack
给我
Critical dependencies:
83:22-54 the request of a dependency is an expression
我不能够解决这个错误。可能的原因是什么?我使用node-express
服务器连续webpack
构建。我也查看了其他答案,但他们没有解决我的问题。
为我节省了大量的时间。谢谢! –