Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update webpack-dev-server@4 #7 #8

Merged
merged 2 commits into from
Sep 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ module.exports = {
},
devServer: {
port: 3000,
host: '0.0.0.0',
contentBase: path.resolve('out'),
historyApiFallback: true,
hot: true,
hotOnly: true,
inline: true,
publicPath: '/',
watchContentBase: true,
writeToDisk: true,
liveReload: false,
devMiddleware: {
writeToDisk: true,
},
static: {
directory: path.resolve('out'),
},
},
};
9 changes: 9 additions & 0 deletions build/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const webpack = require('webpack');
const path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin');

const isProduction = process.env.NODE_ENV === 'production';

Expand Down Expand Up @@ -42,6 +43,14 @@ module.exports = {
template: 'src/index.html',
filename: '../index.html',
}),
new CopyPlugin({
patterns: [
{
from: 'public',
to: path.join(path.resolve(__dirname, '../'), 'out'),
},
],
}),
],
output: {
filename: '[name].js',
Expand Down
6,556 changes: 1,254 additions & 5,302 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "react-starter-kit",
"version": "1.0.2",
"description": "",
"main": "index.js",
"version": "1.1.0",
"description": "React starter kit",
"main": "out/dist/app.js",
"scripts": {
"dev": "webpack server --config build/webpack.config.dev.js --mode development",
"build:dev": "webpack --config build/webpack.config.dev.js",
Expand Down Expand Up @@ -47,6 +47,7 @@
"@typescript-eslint/parser": "^4.15.2",
"babel-loader": "^8.2.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"copy-webpack-plugin": "^9.0.1",
"cross-env": "^7.0.3",
"css-loader": "^5.1.0",
"eslint": "^7.20.0",
Expand All @@ -59,8 +60,8 @@
"react-refresh": "^0.10.0",
"style-loader": "^2.0.0",
"typescript": "^4.2.2",
"webpack": "^5.40.0",
"webpack": "^5.52.1",
"webpack-cli": "^4.8.0",
"webpack-dev-server": "^3.11.2"
"webpack-dev-server": "^4.2.0"
}
}
Binary file added public/favicon.ico
Binary file not shown.
Binary file added public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta name="description" content="react-starter-kit" />
<meta name="og:title" content="react-starter-kit" />
<meta name="og:site_name" content="react-starter-kit" />
<meta name="og:description" content="react-starter-kit" />
<meta name="og:image" content="icon.png" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<title>React Starter Kit</title>
<link href="./favicon.ico" rel="shortcut icon" />
<link href="./icon.png" sizes="512*512" rel="apple-touch-icon" />
</head>
<body>
<noscript>
Expand Down