Bones/node_modules/browser-sync-ui/lib/plugins/connections/connections.plugin.js
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00

45 lines
863 B
JavaScript

var connections = require("./lib/connections");
const PLUGIN_NAME = "Connections";
/**
* @type {{plugin: Function, plugin:name: string, markup: string}}
*/
module.exports = {
/**
* @param {UI} ui
* @param {BrowserSync} bs
*/
"plugin": function (ui, bs) {
connections.init(ui, bs);
},
/**
* Hooks
*/
"hooks": {
"client:js": fileContent("/connections.client.js"),
"templates": [
getPath("/connections.directive.html")
]
},
/**
* Plugin name
*/
"plugin:name": PLUGIN_NAME
};
/**
* @param filepath
* @returns {*}
*/
function getPath (filepath) {
return require("path").join(__dirname, filepath);
}
/**
* @param filepath
* @returns {*}
*/
function fileContent (filepath) {
return require("fs").readFileSync(getPath(filepath), "utf-8");
}