Helper code for streamlining Graylog web interface plugin development
npm install graylog-web-pluginGraylog Web Plugin Archetype
============================
This module is supposed to help with developing web interface plugins for Graylog. It provides classes which help generating a webpack configuration, defining the plugin manifest (metadata as well as entities which are provided to the web interface) as well as the PluginStore class which is used for registering plugins to make them accessible for the web interface.
This module is supposed to be used in conjunction with the maven archetype which can be found here and requires a checkout of the Graylog server repository in some place.
npm install --save graylog-web-plugin
```
$ npm init
[...]
$ npm --save-dev graylog-web-plugin
Create a file named build.config.js in your plugin directory, looking like this:
``
module.exports = {
web_src_path: '
};
and use a webpack.config.js like this:
`
const PluginWebpackConfig = require('graylog-web-plugin').PluginWebpackConfig;
const loadBuildConfig = require('graylog-web-plugin').loadBuildConfig;
const path = require('path');
const buildConfig = loadBuildConfig(path.resolve(__dirname, './build.config'));
module.exports = new PluginWebpackConfig('my.fully.qualified.plugin.classname', buildConfig, {
// Here goes your additional webpack configuration.
});
`
The third (optional) parameter for the PluginWebpackConfig constructor is an object which is merged into the generated webpack config, so you can add/overwrite any part of the generated configuration.
Feel free to contribute to this collection of helpers by forking the repository and submitting a pull request. Thanks!