Update webpack-dev-server to 4.0.0-beta1 (#71)

When using the old webpack-dev-server with webpack 5+, we get bitten
by webpack/webpack-dev-server#2692. This upgrades to 4.0.0-beta1 which
also (unhelpfully) changes the config options.  The `watchContentBase`
and `watchOptions` don't seem to have analogs in the new versions, but
I left them commented out for future reference.

Also, this does not update `package-lock.json` because even just
updating locally gave different output since I'm on a different
version of node, I'm guessing.
This commit is contained in:
Ian Flanigan 2021-03-26 21:21:45 +01:00 committed by GitHub
parent 8f20fb8829
commit 54eddb178c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 13 deletions

View File

@ -1,3 +1,5 @@
var Apple2 = require('./main2'); import { apple2 as _apple2 } from './main2';
import * as UI from './ui/apple2';
module.exports = { Apple2: Apple2 }; export const Apple2 = UI;
export const apple2 = _apple2;

View File

@ -1,3 +1,5 @@
var Apple2 = require('./main2e'); import { apple2 as _apple2 } from './main2e';
import * as UI from './ui/apple2';
module.exports = { Apple2: Apple2 }; export const Apple2 = UI;
export const apple2 = _apple2;

View File

@ -41,7 +41,7 @@
"typescript": "^4.1.3", "typescript": "^4.1.3",
"webpack": "^5.28.0", "webpack": "^5.28.0",
"webpack-cli": "^4.5.0", "webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.0" "webpack-dev-server": "^4.0.0-beta.1"
}, },
"dependencies": { "dependencies": {
"apple2shader": "whscullin/apple2shader#f42252d8c2ad7055e3e5f5c39e235a710804e7a6", "apple2shader": "whscullin/apple2shader#f42252d8c2ad7055e3e5f5c39e235a710804e7a6",

View File

@ -3,23 +3,31 @@ const path = require('path');
module.exports = module.exports =
{ {
devtool: 'source-map', devtool: 'source-map',
mode: 'development',
entry: { entry: {
main2: path.resolve('js/entry2.js'), main2: path.resolve('js/entry2.js'),
main2e: path.resolve('js/entry2e.js') main2e: path.resolve('js/entry2e.js')
}, },
output: { output: {
path: path.resolve('dist/'), path: path.resolve('dist/'),
library: 'Apple2', library: {
libraryExport: 'Apple2', name: 'Apple2',
libraryTarget: 'var' type: 'umd',
export: 'Apple2',
},
}, },
devServer: { devServer: {
compress: true, compress: true,
publicPath: '/dist/', static: {
watchContentBase: true, watch: false,
watchOptions: { directory: __dirname,
ignored: ['**/node_modules/', '**/.git/'] },
} dev: {
publicPath: '/dist/',
},
// watchContentBase: true,
// watchOptions: {
// ignored: ['**/node_modules/', '**/.git/']
}, },
module: { module: {
rules: [ rules: [