Open samuelthomas2774 opened 5 years ago
Patch Module._load to allow plugins to require the plugin API when they load instead of having to wrap every module in a function:
// index.js const Plugin = require('betterdiscord/plugin'); const SomeComponent = require('./component'); module.exports = class extends Plugin { // ... }
// component.js const { Vuewrap } = require('betterdiscord/plugin-api'); module.exports = props => { return Vuewrap('somecomponent', { // ... }); }
I like this change, something I wanted to do for awhile. I am at work now so I've only skimmed through it, but I don't see any huge issues. I'll take a closer look tonight when I get home.
Patch Module._load to allow plugins to require the plugin API when they load instead of having to wrap every module in a function: