Skip to content

react-scripts package: Resolving vulnerabilities by updating dependencies + .SVG loader bug fix #13778

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
58,783 changes: 21,965 additions & 36,818 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 13 additions & 7 deletions packages/react-scripts/config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -385,8 +385,12 @@ module.exports = function (webpackEnv) {
},
},
},
// Restrict to JavaScript/TypeScript files
{
test: /\.svg$/,
issuer: {
and: [/\.(ts|tsx|js|jsx)$/],
},
use: [
{
loader: require.resolve('@svgr/webpack'),
@@ -400,15 +404,17 @@ module.exports = function (webpackEnv) {
ref: true,
},
},
{
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash].[ext]',
},
},
],
},
// Exclude JavaScript/TypeScript files
{
test: /\.svg$/,
issuer: {
and: [/\.(ts|tsx|js|jsx|md|mdx)$/],
not: [/\.(ts|tsx|js|jsx)$/],
},
type: 'asset/resource',
generator: {
filename: 'static/media/[name].[hash][ext]',
},
},
// Process application JS with Babel.
8 changes: 4 additions & 4 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scripts",
"version": "5.0.1",
"version": "5.0.2",
"description": "Configuration and scripts for Create React App.",
"repository": {
"type": "git",
@@ -28,9 +28,9 @@
},
"types": "./lib/react-app.d.ts",
"dependencies": {
"@babel/core": "^7.16.0",
"@babel/core": "^7.21.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
"@svgr/webpack": "^5.5.0",
"@svgr/webpack": "^8.1.0",
"babel-jest": "^27.4.2",
"babel-loader": "^8.2.3",
"babel-plugin-named-asset-import": "^0.3.8",
@@ -64,7 +64,7 @@
"react-dev-utils": "^12.0.1",
"react-refresh": "^0.11.0",
"resolve": "^1.20.0",
"resolve-url-loader": "^4.0.0",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^12.3.0",
"semver": "^7.3.5",
"source-map-loader": "^3.0.0",