SimpleStarter.js 484 B

12345678910111213141516
  1. const Webpack = require('webpack');
  2. const WebpackDevServer = require('webpack-dev-server');
  3. const webpackConfig = require('./webpack.config.js');
  4. webpackConfig.mode = "development";
  5. const compiler = Webpack(webpackConfig);
  6. const devServerOptions = { ...webpackConfig.devServer, open: true };
  7. const server = new WebpackDevServer(devServerOptions, compiler);
  8. const runServer = async () => {
  9. console.log('Starting server...');
  10. await server.start();
  11. };
  12. runServer();