Exports plugin function from index.js
merged with master