Skip to content

Commit e88ec89

Browse files
committed
[dashboard] Optimize build
1 parent 686fa0c commit e88ec89

File tree

9 files changed

+407
-341559
lines changed

9 files changed

+407
-341559
lines changed

components/dashboard/.eslintrc.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
module.exports = {
8+
root: true,
9+
extends: ['react-app'],
10+
}

components/dashboard/BUILD.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ packages:
1111
- package.json
1212
- tailwind.config.js
1313
- tsconfig.*
14+
- craco.config.js
15+
- postcss.config.js
16+
- .eslintrc.js
1417
deps:
1518
- components/gitpod-protocol:lib
1619
config:

components/dashboard/craco.config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
module.exports = {
8+
style: {
9+
postcss: {
10+
plugins: [
11+
require('tailwindcss'),
12+
require('autoprefixer'),
13+
],
14+
}
15+
}
16+
}

components/dashboard/package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,38 @@
1414
"xterm-addon-fit": "^0.5.0"
1515
},
1616
"devDependencies": {
17-
"@tailwindcss/forms": "^0.2.1",
18-
"@tailwindcss/postcss7-compat": "^2.0.2",
19-
"@testing-library/jest-dom": "^5.11.4",
20-
"@testing-library/react": "^11.1.0",
17+
"@craco/craco": "^6.1.1",
18+
"@tailwindcss/forms": "^0.3.2",
19+
"@tailwindcss/postcss7-compat": "^2.1.0",
20+
"@testing-library/jest-dom": "^5.11.10",
21+
"@testing-library/react": "^11.2.6",
2122
"@testing-library/user-event": "^12.1.10",
2223
"@types/classnames": "^2.2.11",
23-
"@types/jest": "^26.0.15",
24+
"@types/jest": "^26.0.22",
2425
"@types/node": "^12.0.0",
2526
"@types/react": "^17.0.0",
26-
"@types/react-dom": "^17.0.0",
27-
"@types/react-router": "^5.1.12",
27+
"@types/react-dom": "^17.0.3",
28+
"@types/react-router": "^5.1.13",
2829
"@types/react-router-dom": "^5.1.7",
29-
"@typescript-eslint/eslint-plugin": "^4.15.2",
30-
"@typescript-eslint/parser": "^4.15.2",
30+
"@typescript-eslint/eslint-plugin": "^4.21.0",
31+
"@typescript-eslint/parser": "^4.21.0",
3132
"autoprefixer": "^9.8.6",
32-
"classnames": "^2.2.6",
33-
"eslint": "^7.21.0",
33+
"classnames": "^2.3.1",
34+
"eslint": "^7.24.0",
35+
"eslint-config-react-app": "^6.0.0",
3436
"postcss": "^7.0.35",
35-
"react-scripts": "4.0.2",
37+
"react-scripts": "^4.0.3",
3638
"tailwind-underline-utils": "^1.1.2",
37-
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.2",
39+
"tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.1.0",
3840
"tailwindcss-filters": "^3.0.0",
3941
"typescript": "~4.1.2",
40-
"web-vitals": "^1.0.1"
42+
"web-vitals": "^1.1.1"
4143
},
4244
"scripts": {
43-
"start": "react-scripts start",
44-
"build": "react-scripts build",
45-
"test": "react-scripts test",
45+
"start": "craco start",
46+
"build": "craco build --verbose",
47+
"test": "craco test",
4648
"eject": "react-scripts eject",
47-
"build:tailwind": "tailwindcss build src/index.css -o src/tailwind.output.css",
48-
"prestart": "npm run build:tailwind",
49-
"prebuild": "npm run build:tailwind",
5049
"telepresence": "TELEPRESENCE_USE_DEPLOYMENT=1 leeway run .:telepresence"
5150
},
5251
"files": [
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) 2021 Gitpod GmbH. All rights reserved.
3+
* Licensed under the GNU Affero General Public License (AGPL).
4+
* See License-AGPL.txt in the project root for license information.
5+
*/
6+
7+
module.exports = {
8+
plugins: {
9+
tailwindcss: {},
10+
autoprefixer: {}
11+
}
12+
}

components/dashboard/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import ReactDOM from 'react-dom';
99
import App from './App';
1010
import { UserContextProvider } from './user-context';
1111

12-
import "./tailwind.output.css"
12+
import "./index.css"
1313

1414
ReactDOM.render(
1515
<React.StrictMode>

0 commit comments

Comments
 (0)