grafana AMD

grafana AMD 配置

经过测试,基本放在
public/app
public/vendor
public/plugins
这三个目录下都能被引入

采用common.js :写法

1
2
3
4
5
6
7
8
define([], function () {
"use strict";
function getValue() {
console.log('getValue plugins 111')
}
return {getValue:getValue}
});

然后在要引用的dashaboards/a.js里面写上

1
2
3
4
System.import('plugins/common').then(function(m){
m.getValue();
})

就可以引用了。