Skip to content

Commit 4714aa0

Browse files
authored
feat: Replace cra with webpack (#41)
* replace cra with webpack * Fix ci
1 parent 6dbbb02 commit 4714aa0

19 files changed

+5076
-11501
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"],
3+
"plugins": ["@babel/plugin-transform-runtime"]
4+
}

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.git
2+
.gitignore
3+
.github
24
node_modules
35
build
46
dist

Dockerfile.dev

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
# Stage 0, "run-stage".
21
FROM node:14-alpine3.12
3-
42
WORKDIR /usr/src/app/
5-
6-
COPY package*.json ./
3+
COPY . .
74
RUN npm install
8-
COPY tsconfig.json .
9-
COPY jest.config.js .
10-
COPY src src
11-
COPY public public
12-
135
USER node
14-
156
ENTRYPOINT [ "npm", "start" ]

package-lock.json

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

package.json

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
"homepage": "./",
55
"private": true,
66
"devDependencies": {
7+
"@babel/core": "^7.12.9",
8+
"@babel/plugin-transform-runtime": "^7.12.1",
9+
"@babel/preset-env": "^7.12.7",
10+
"@babel/preset-react": "^7.12.7",
11+
"@babel/preset-typescript": "^7.12.7",
12+
"@babel/runtime": "^7.12.5",
713
"@testing-library/jest-dom": "^5.11.5",
814
"@testing-library/react": "^11.1.2",
915
"@types/jest": "26.0.15",
@@ -13,16 +19,32 @@
1319
"@types/react-dom": "16.9.9",
1420
"@types/react-redux": "^7.1.11",
1521
"@types/styled-components": "^5.1.4",
16-
"react-scripts": "^4.0.0",
22+
"babel-loader": "^8.2.2",
23+
"buffer": "^6.0.3",
24+
"clean-webpack-plugin": "^3.0.0",
25+
"copy-webpack-plugin": "^6.3.2",
26+
"css-loader": "^5.0.1",
27+
"css-minimizer-webpack-plugin": "^1.1.5",
28+
"fork-ts-checker-webpack-plugin": "^6.0.5",
29+
"html-webpack-plugin": "^4.5.0",
30+
"https-browserify": "^1.0.0",
31+
"identity-obj-proxy": "^3.0.0",
32+
"jest": "^26.6.3",
33+
"mini-css-extract-plugin": "^1.3.2",
34+
"process": "^0.11.10",
35+
"stream-http": "^3.1.1",
1736
"ts-jest": "^26.4.4",
18-
"typescript": "4.0.5"
37+
"typescript": "4.0.5",
38+
"webpack": "^5.10.0",
39+
"webpack-bundle-analyzer": "^4.2.0",
40+
"webpack-cli": "^4.2.0",
41+
"webpack-dev-server": "^3.11.0"
1942
},
2043
"scripts": {
21-
"start": "react-scripts start",
22-
"build": "react-scripts build",
23-
"test": "react-scripts test",
24-
"test:watch": "react-scripts test --watch",
25-
"eject": "react-scripts eject",
44+
"start": "webpack serve",
45+
"build": "NODE_ENV=production webpack",
46+
"bundle-analyze": "NODE_ENV=production webpack --analyze",
47+
"test": "jest",
2648
"deploy": "gh-pages -u 'Deploy Bot <no-reply@teamdigitale.governo.it>' -d build"
2749
},
2850
"dependencies": {

public/favicon.ico

-3.08 KB
Binary file not shown.

public/index.html

Lines changed: 0 additions & 43 deletions
This file was deleted.

public/logo192.png

-5.22 KB
Binary file not shown.

public/logo512.png

-9.44 KB
Binary file not shown.

public/manifest.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/App.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import React from "react";
2020
// import { render } from "@testing-library/react";
2121
import { App } from "./App";
22+
// @ts-ignore
2223
import { render, fireEvent, screen } from '../test-utils';
2324

2425

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818

1919
import React, {useState} from "react";
20-
// import logo from "./logo.svg";
2120
import "./App.css";
2221

2322
import { HeaderBar } from "./components/HeaderBar";

src/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1" />
6+
<title>Form PA</title>
7+
</head>
8+
<body>
9+
<noscript>You need to enable JavaScript to run this app.</noscript>
10+
<div id="root"></div>
11+
</body>
12+
</html>

src/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import React from "react";
2020
import ReactDOM from "react-dom";
2121
import "./index.css";
2222
import { App } from "./App";
23-
import * as serviceWorker from "./serviceWorker";
2423

2524
import { Provider } from "react-redux";
2625

@@ -39,9 +38,4 @@ ReactDOM.render(
3938
</Provider>
4039
</React.StrictMode>,
4140
document.getElementById("root")
42-
);
43-
44-
// If you want your app to work offline and load faster, you can change
45-
// unregister() to register() below. Note this comes with some pitfalls.
46-
// Learn more about service workers: https://bit.ly/CRA-PWA
47-
serviceWorker.unregister();
41+
);

src/logo.svg

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/react-app-env.d.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/serviceWorker.ts

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)