mattermost-desktop/scripts/watch.js
aaron 057377207a
Some checks failed
release / begin-notification (push) Has been cancelled
release / build-linux (push) Has been cancelled
release / build-msi-installer (push) Has been cancelled
release / build-mac-installer (push) Has been cancelled
release / upload-to-s3 (push) Has been cancelled
release / github-release (push) Has been cancelled
release / end-notification (push) Has been cancelled
first commit bois
2024-10-03 06:35:14 -07:00

27 lines
956 B
JavaScript

// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
const electron = require('electron-connect').server.create({path: 'dist/'});
const webpack = require('webpack');
const mainConfig = require('../webpack.config.main.js');
const preloadConfig = require('../webpack.config.preload.js');
const rendererConfig = require('../webpack.config.renderer.js');
Promise.all([mainConfig, preloadConfig, rendererConfig].map((config) => {
return new Promise((resolve) => {
const compiler = webpack(config);
compiler.watch({}, (err, stats) => {
if (err) {
console.error(err);
}
process.stdout.write(stats.toString({colors: true}));
process.stdout.write('\n');
if (!stats.hasErrors()) {
electron.restart();
}
resolve();
});
});
})).then(() => electron.start());