Make sure you add the package semveras a dependency, and then:
var semver = require("semver")
var plugins = [
require("a"),
require("b"),
];
if(semver.gt(process.version, "0.11")){
plugins.push(require("c"));
}
module.exports = {
plugins: plugins
};
This code checks the version of node with process.versionand adds the required plugin to the list, if supported.
source
share