diff --git a/common/modules/bdipc.js b/common/modules/bdipc.js index 02ab2caf..09b808af 100644 --- a/common/modules/bdipc.js +++ b/common/modules/bdipc.js @@ -12,7 +12,7 @@ import { ipcRenderer } from 'electron'; const callbacks = new WeakMap(); -export default new class ClientIPC { +const ClientIPC = new class ClientIPC { constructor() { this.on('ping', () => 'pong', true); @@ -114,6 +114,8 @@ export default new class ClientIPC { } +export default ClientIPC; + /** * An IPC event. */ diff --git a/csseditor/src/BDIpc.js b/csseditor/src/BDIpc.js deleted file mode 100644 index 711a669b..00000000 --- a/csseditor/src/BDIpc.js +++ /dev/null @@ -1,28 +0,0 @@ -const { ipcRenderer } = window.require('electron'); - -export default class { - - static on(channel, cb) { - ipcRenderer.on(channel, (event, args) => cb(event, args)); - } - - static async send(channel, message) { - const __eid = Date.now().toString(); - ipcRenderer.send( - channel.startsWith('bd-') ? channel: `bd-${channel}`, - message === undefined ? { __eid } : Object.assign(message, { __eid }) - ); - - return new Promise((resolve, reject) => { - ipcRenderer.once(__eid, (event, arg) => { - if (arg.err) return reject(arg); - resolve(arg); - }); - }); - } - - static sendToDiscord(channel, message) { - this.send('bd-sendToDiscord', { channel, message }); - } - -} diff --git a/csseditor/webpack.production.config.js b/csseditor/webpack.production.config.js index c7bba6f8..8d2cd354 100644 --- a/csseditor/webpack.production.config.js +++ b/csseditor/webpack.production.config.js @@ -17,7 +17,7 @@ module.exports = { entry: './src/index.js', output: { path: path.resolve(__dirname, 'dist'), - filename: 'csseditor.js' + filename: 'csseditor-release.js' }, module: { loaders: [vueLoader, scssLoader] diff --git a/gulpfile.js b/gulpfile.js index 1335ff61..a6d5a2d2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -58,7 +58,8 @@ const index = function() { const cssEditor = function() { return pump([ - gulp.src('./csseditor/dist/**/*'), + gulp.src('./csseditor/dist/csseditor-release.js'), + rename('csseditor.js'), copy('release/csseditor', { prefix: 2 }) ]); };