const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const useTypeScript = process.argv.includes('--typescript');

const config = require(
  useTypeScript ?
  './webpack-ts.config.js' :
  './webpack.config.js',
);

new WebpackDevServer(webpack(config), {
  publicPath: '/',
  hot: true,
  historyApiFallback: true,
}).listen(8080, 'localhost', function(err, result) {
  if (err) {
    return console.log(err);
  }

  console.log('Listening localhost:8080');
});

const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const useTypeScript = process.argv.includes('--typescript');

const config = require(
  useTypeScript ?
  './webpack-ts.config.js' :
  './webpack.config.js',
);

new WebpackDevServer(webpack(config), {
  hot: true,
  historyApiFallback: true,
}).listen(8080, 'localhost', function(err, result) {
  if (err) {
    return console.log(err);
  }

  console.log('Listening localhost:8080');
});

Remove invalid publicPath devServer option
Remove invalid publicPath devServer option

The option may have been moved to a property of a nested config object
https://stackoverflow.com/questions/69645259/webpack-config-has-an-unknown-property-publicpath
or maybe it never worked, idk. Anyway, it doesn't seem to be needed
anymore, so I'll just remove it and everything seems to work fine.
