Skip to content

Commit

Permalink
test(integrations): switch react-scripts to webpack (#8329)
Browse files Browse the repository at this point in the history
* chore: switch CRA 4 to webpack 4

* pnpm dedupe

* test(integrations): switch CRA 5 to webpack 5

* Better dep vs devDep separation

* Fix lockfile
  • Loading branch information
lachlancollins authored Nov 24, 2024
1 parent 2588a08 commit b846c53
Show file tree
Hide file tree
Showing 23 changed files with 2,086 additions and 7,435 deletions.
1 change: 0 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"node",
"react",
"react-dom",
"react-scripts",
"tsup",
"typescript",
"typescript47",
Expand Down
42 changes: 0 additions & 42 deletions .pnpmfile.cjs

This file was deleted.

9 changes: 0 additions & 9 deletions integrations/react-cra4/.eslintrc.cjs

This file was deleted.

23 changes: 0 additions & 23 deletions integrations/react-cra4/.gitignore

This file was deleted.

29 changes: 0 additions & 29 deletions integrations/react-cra4/package.json

This file was deleted.

1 change: 0 additions & 1 deletion integrations/react-cra4/src/react-app-env.d.ts

This file was deleted.

20 changes: 0 additions & 20 deletions integrations/react-cra4/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions integrations/react-cra5/.eslintrc.cjs

This file was deleted.

23 changes: 0 additions & 23 deletions integrations/react-cra5/.gitignore

This file was deleted.

29 changes: 0 additions & 29 deletions integrations/react-cra5/package.json

This file was deleted.

1 change: 0 additions & 1 deletion integrations/react-cra5/src/react-app-env.d.ts

This file was deleted.

20 changes: 0 additions & 20 deletions integrations/react-cra5/tsconfig.json

This file was deleted.

23 changes: 23 additions & 0 deletions integrations/react-webpack-4/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "react-webpack-4",
"private": true,
"scripts": {
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --mode production"
},
"dependencies": {
"@tanstack/react-query": "workspace:*",
"@tanstack/react-query-devtools": "workspace:*",
"react": "19.0.0-rc-4c2e457c7c-20240522",
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"babel-loader": "^8.3.0",
"cross-env": "^7.0.3",
"html-webpack-plugin": "^4.5.2",
"webpack": "^4.44.2",
"webpack-cli": "^4.10.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>React App</title>
<meta charset="UTF-8" />
<title>react-webpack-4</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions integrations/react-webpack-4/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const HtmlWebPackPlugin = require('html-webpack-plugin')

const htmlPlugin = new HtmlWebPackPlugin({
template: './public/index.html',
filename: './index.html',
})

module.exports = {
module: {
rules: [
{
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
},
},
},
],
},
plugins: [htmlPlugin],
}
22 changes: 22 additions & 0 deletions integrations/react-webpack-5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "react-webpack-5",
"private": true,
"scripts": {
"build": "webpack --mode production"
},
"dependencies": {
"@tanstack/react-query": "workspace:*",
"@tanstack/react-query-devtools": "workspace:*",
"react": "19.0.0-rc-4c2e457c7c-20240522",
"react-dom": "19.0.0-rc-4c2e457c7c-20240522"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/preset-env": "^7.26.0",
"@babel/preset-react": "^7.25.9",
"babel-loader": "^9.2.1",
"html-webpack-plugin": "^5.6.3",
"webpack": "^5.96.1",
"webpack-cli": "^5.1.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>React App</title>
<meta charset="UTF-8" />
<title>react-webpack-5</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions integrations/react-webpack-5/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const HtmlWebPackPlugin = require('html-webpack-plugin')

const htmlPlugin = new HtmlWebPackPlugin({
template: './public/index.html',
filename: './index.html',
})

module.exports = {
module: {
rules: [
{
test: /\.(?:js|mjs|cjs|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-env', '@babel/preset-react'],
},
},
},
],
},
plugins: [htmlPlugin],
}
Loading

0 comments on commit b846c53

Please sign in to comment.