[PCCompat] Use powercord import instead of window global

This commit is contained in:
Ducko 2021-04-04 19:00:26 +01:00 committed by Keanu
parent ac3778e574
commit d94d7bfc42
Signed by: keanucode
GPG Key ID: A7431C0D513CA93B
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
// Also set Powercord global var stuff here since entities import is needed to use Plugin (which every PC plugin uses)
window.powercord = {
export const powercord = {
api: {
commands: {
registerCommand: ({ command, alias, description, usage, executor }) => {

View File

@ -19,7 +19,7 @@ export default (manifestPath, repo) => {
const content = readFileSync(pcManifest.main || 'index.js', 'utf8');//.replace(/\\/g, '\\\\').replace(/`/g, '\\`');
const jsCode = content.replace(`module.exports = class`, `export default new class`);
const jsCode = content.replace(`module.exports = class`, `export default new class`).replace(/{ *Plugin *}/, `{ Plugin, powercord }`);
writeFileSync(`${manifestPath}/goosemodModule.json`, JSON.stringify(manifest));
writeFileSync(`${manifestPath}/index.js`, jsCode);