-1
我想在require配置中創建一個不存在的模塊,但只有加載依賴關係。例如:Requirejs創建空模塊作爲依賴加載程序
window["requirejs"].config({
paths: {
main : "/Scripts/" + "/main",
jquery : "/Scripts/" + "/jquery-2.1.3.min",
HiChartsWithExtensions : false,//what to put here???
HighCharts : "/Scripts/" + "/HighCharts/highcharts",
HighChartsExporting : "/Scripts/" + "/HighCharts/modules/exporting",
HighChartsExportingCsv : "/Scripts/" + "/HighCharts/modules/export-csv",
}
, shim : {
main : {
deps : ["HiChartsWithExtensions"]
},
HiChartsWithExtensions : {
deps : ["HighChartsExporting"]
},
HighCharts: {
deps : ["jquery"],
exports: '$'
},
"HighChartsExporting" : {
deps : ["HighCharts"]
},
"HighChartsExportingCsv" : {
deps : ["HighChartsExporting"]
}
}
});
window["require"](['main']);
如主要取決於HiChartsWithExtensions但requirejs嘗試加載一個js文件它。我希望HiChartsWithExtensions加載依賴關係,而無需實際返回任何內容。