feat: add electron app.

This commit is contained in:
jaywcjlove
2022-09-04 22:09:04 +08:00
parent a66e906eef
commit 76a6f48d0a
62 changed files with 483 additions and 98 deletions

15
electron/app/main.js Normal file
View File

@@ -0,0 +1,15 @@
const path = require('path');
const { App } = require('@wcj/wxmp-main');
(async () => {
const options = {};
if (process.env.NODE_ENV === 'development') {
options.preload = require.resolve('@wcj/wxmp-preload');
options.webpath = require.resolve('website/build/index.html');
} else {
options.preload = path.resolve(__dirname, 'website/index.js');
options.webpath = 'website/index.html';
}
const app = new App();
await app.createWindow(options);
})();