mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-14 07:02:30 +01:00
1e62aa976d
this should greatly reduce the complexity of the l10n code and build pipeline and eliminate the most common error seen in sentry logs (no translate function)
33 lines
1004 B
JavaScript
33 lines
1004 B
JavaScript
let server = null;
|
|
|
|
module.exports = {
|
|
onPrepare: function() {
|
|
return new Promise(function(resolve) {
|
|
const webpack = require('webpack');
|
|
const middleware = require('webpack-dev-middleware');
|
|
const express = require('express');
|
|
const expressWs = require('express-ws');
|
|
const assets = require('../common/assets');
|
|
const routes = require('../server/routes');
|
|
const tests = require('./frontend/routes');
|
|
const app = express();
|
|
const config = require('../webpack.config');
|
|
const wpm = middleware(webpack(config(null, { mode: 'development' })), {
|
|
logLevel: 'silent'
|
|
});
|
|
app.use(wpm);
|
|
assets.setMiddleware(wpm);
|
|
expressWs(app, null, { perMessageDeflate: false });
|
|
app.ws('/api/ws', require('../server/routes/ws'));
|
|
routes(app);
|
|
tests(app);
|
|
wpm.waitUntilValid(() => {
|
|
server = app.listen(8000, resolve);
|
|
});
|
|
});
|
|
},
|
|
onComplete: function() {
|
|
server.close();
|
|
}
|
|
};
|