/** * Copyright (c) 2018 The xterm.js authors. All rights reserved. * @license MIT * * This file is the entry point for browserify. */ const cp = require('child_process'); const path = require('path'); const webpack = require('webpack'); // Launch server cp.spawn('node', [path.resolve(__dirname, 'server.js')], { stdio: 'inherit' }); // Build/watch client source const clientConfig = { entry: path.resolve(__dirname, 'client.js'), devtool: 'inline-source-map', output: { filename: 'client-bundle.js', path: path.resolve(__dirname, 'dist') }, mode: 'development', watch: true }; const compiler = webpack(clientConfig); compiler.watch({ // Example watchOptions aggregateTimeout: 300, poll: undefined }, (err, stats) => { // Print watch/build result here... console.log(stats.toString({ colors: true })); });