Skip to content

Commit 0de05b6

Browse files
author
Oleksandr_Halichenko
committed
added inline config
1 parent 77d7d15 commit 0de05b6

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

config/webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const ModuleNotFoundPlugin = require('react-dev-utils/ModuleNotFoundPlugin');
2626
const ForkTsCheckerWebpackPlugin = require('react-dev-utils/ForkTsCheckerWebpackPlugin');
2727
const typescriptFormatter = require('react-dev-utils/typescriptFormatter');
2828
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
29+
const HTMLInlineCSSWebpackPlugin = require('html-inline-css-webpack-plugin').default;
2930

3031
const postcssNormalize = require('postcss-normalize');
3132

@@ -588,7 +589,7 @@ module.exports = function (webpackEnv) {
588589
// https://github.com/facebook/create-react-app/issues/5358
589590
isEnvProduction &&
590591
shouldInlineRuntimeChunk &&
591-
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/runtime-.+[.]js/]),
592+
new InlineChunkHtmlPlugin(HtmlWebpackPlugin, [/.+[.]js/]),
592593
// Makes some environment variables available in index.html.
593594
// The public URL is available as %PUBLIC_URL% in index.html, e.g.:
594595
// <link rel="icon" href="%PUBLIC_URL%/favicon.ico">
@@ -737,6 +738,7 @@ module.exports = function (webpackEnv) {
737738
},
738739
},
739740
}),
741+
new HTMLInlineCSSWebpackPlugin(),
740742
].filter(Boolean),
741743
// Some libraries import Node modules but don't use them in the browser.
742744
// Tell webpack to provide empty mocks for them so importing them works.

package-lock.json

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
"file-loader": "6.1.1",
3737
"fs-extra": "^9.0.1",
3838
"history": "^4.10.1",
39+
"html-inline-css-webpack-plugin": "^1.11.1",
3940
"html-webpack-plugin": "4.5.0",
4041
"identity-obj-proxy": "3.0.0",
42+
"inline-chunk-html-plugin": "^1.1.1",
4143
"jest": "26.6.0",
4244
"jest-circus": "26.6.0",
4345
"jest-resolve": "26.6.0",

public/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
65
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
76
<meta name="theme-color" content="#000000">
87
<!--
98
manifest.json provides metadata used when your web app is added to the
109
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
1110
-->
12-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
1311
<!--
1412
Notice the use of %PUBLIC_URL% in the tags above.
1513
It will be replaced with the URL of the `public` folder during the build.

0 commit comments

Comments
 (0)