Skip to content

Commit

Permalink
build: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
haishanh committed Nov 9, 2020
1 parent 1b95680 commit 62c1f1d
Show file tree
Hide file tree
Showing 5 changed files with 221 additions and 182 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
webpack.config.js
server.js
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const presets = [
modules: false,
// see also zloirock/core-js https://bit.ly/2JLnrgw
useBuiltIns: 'usage',
corejs: '3.6',
corejs: '3.7',
// new in babel 7.9.0 https://babeljs.io/blog/2020/03/16/7.9.0
bugfixes: true,
},
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@sentry/browser": "^5.27.3",
"chart.js": "^2.9.2",
"clsx": "^1.1.0",
"core-js": "^3.6.2",
"core-js": "^3.7.0",
"date-fns": "^2.16.0",
"fontsource-open-sans": "^3.0.9",
"fontsource-roboto-mono": "^3.0.3",
Expand All @@ -63,7 +63,7 @@
"react-tabs": "^3.1.0",
"react-tiny-fab": "^3.5.0",
"react-window": "^1.8.5",
"recoil": "^0.0.13",
"recoil": "^0.1.2",
"regenerator-runtime": "^0.13.7",
"reselect": "^4.0.0",
"workbox-core": "^5.1.4",
Expand Down Expand Up @@ -101,8 +101,8 @@
"css-loader": "^5.0.1",
"css-minimizer-webpack-plugin": "^1.1.5",
"cssnano": "^4.1.7",
"eslint": "^7.11.0",
"eslint-config-airbnb-base": "^14.1.0",
"eslint": "^7.13.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^6.11.0",
"eslint-config-react-app": "^6.0.0",
"eslint-import-resolver-webpack": "^0.13.0",
Expand All @@ -115,11 +115,11 @@
"eslint-plugin-simple-import-sort": "^5.0.3",
"file-loader": "^6.1.1",
"fork-ts-checker-notifier-webpack-plugin": "^3.0.0",
"fork-ts-checker-webpack-plugin": "^5.2.0",
"fork-ts-checker-webpack-plugin": "^6.0.1",
"html-webpack-plugin": "^4.5.0",
"husky": "^4.3.0",
"lint-staged": "^10.5.1",
"mini-css-extract-plugin": "^1.0.0",
"mini-css-extract-plugin": "^1.3.0",
"postcss": "^8.1.6",
"postcss-custom-media": "^7.0.8",
"postcss-extend-rule": "^3.0.0",
Expand All @@ -132,12 +132,12 @@
"resize-observer-polyfill": "^1.5.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.0.0",
"ts-loader": "^8.0.9",
"ts-loader": "^8.0.10",
"typescript": "4.1.0-beta",
"webpack": "^5.4.0",
"webpack-bundle-analyzer": "^3.9.0",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.2.0",
"webpack-dev-middleware": "^3.7.2",
"webpack-dev-middleware": "^4.0.0",
"webpack-hot-middleware": "^2.22.2",
"workbox-webpack-plugin": "^5.1.4"
}
Expand Down
20 changes: 4 additions & 16 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const hotMiddleware = require('webpack-hot-middleware');

const { PORT } = process.env;
const port = PORT ? Number(PORT) : 3000;
const publicPath = config.output.publicPath;

config.entry.app.import.unshift('webpack-hot-middleware/client');
config.plugins.push(
Expand All @@ -17,28 +18,15 @@ config.plugins.push(
);

const compiler = webpack(config);
// webpack-dev-server config
const publicPath = config.output.publicPath;
const stats = {
colors: true,
version: false,
modulesSort: 'issuer',
assets: false,
cached: false,
cachedAssets: false,
chunks: false,
chunkModules: false,
};

const options = { publicPath, stats };

const wdm = devMiddleware(compiler, options);
const wdm = devMiddleware(compiler, { publicPath });
const whm = hotMiddleware(compiler);

app.use(wdm);
app.use(whm);

app.get('/_dev', (_req, res) => {
const outputPath = wdm.getFilenameFromUrl(options.publicPath || '/');
const outputPath = wdm.getFilenameFromUrl(publicPath || '/');
const filesystem = wdm.fileSystem;
const content = filesystem.readdirSync(outputPath);
res.end(content.join('\n'));
Expand Down
Loading

0 comments on commit 62c1f1d

Please sign in to comment.