Skip to content
Snippets Groups Projects
Commit 7d803c17 authored by Max Frederiksen's avatar Max Frederiksen Committed by Max Frederiksen
Browse files

modify react-scripts, docs and build scripts

parent 584b032f
No related branches found
No related tags found
2 merge requests!612Release 5.0.0,!569CE-3116: Cleanup react scripts
......@@ -22,7 +22,7 @@ install-dependencies:
lint:
stage: check
script:
- npm run code-quality
- npm run ci:code-quality
artifacts:
reports:
codequality: gl-codequality.json
......
......@@ -7,7 +7,7 @@ ENV PATH /usr/src/app/node_modules/.bin:$PATH
COPY . /usr/src/app
RUN npm ci
RUN VITE_APP_MUI_PRO_LICENSE_KEY=${REACT_APP_MUI_PRO_LICENSE_KEY} npm run build
RUN VITE_APP_MUI_PRO_LICENSE_KEY=${REACT_APP_MUI_PRO_LICENSE_KEY} npm run ci:build
# production environment
FROM nginx:1.19.6-alpine
......
......@@ -68,7 +68,7 @@ Environment variables are stored in `.env` files.
Precedency of environment variable files are (files on the left have more priority than files on the right):
- npm start: `.env.development.local`, `.env.local`, `.env.development`, `.env`
- npm run build: `.env.production.local`, `.env.local`, `.env.production`, `.env`
- npm run ci:build: `.env.production.local`, `.env.local`, `.env.production`, `.env`
All environment variables start with `REACT_APP_` prefix.
......@@ -151,7 +151,6 @@ npx cypress open
To run Cypress tests from command line (without the test-dialog), enter
```bash
npx cypress run
```
......@@ -159,7 +158,7 @@ npx cypress run
## Building
```bash
npm run build
npm run ci:build
```
Builds the app for production to the `build` folder.\
......
......@@ -37,7 +37,7 @@
Unlike "/favicon.ico" or "favicon.ico", "/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
Learn how to configure a non-root public URL by running `npm run ci:build`.
-->
</head>
<body>
......@@ -51,9 +51,12 @@
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
To create a production bundle, use `npm run ci:build` or `yarn ci:build`.
-->
<script src="/config.js"></script>
<script type="module" src="/src/index.jsx"></script>
<script
type="module"
src="/src/index.jsx"
></script>
</body>
</html>
......@@ -21,22 +21,16 @@
},
"scripts": {
"start": "vite",
"test": "npm run testComponents",
"cypress:open": "cypress open --component",
"build": "tsc && vite build",
"preview": "vite preview",
"testComponents": "npx cypress run --component --browser chrome",
"code-quality": "eslint src --ext .js,.ts,.jsx,.tsx -o eslint/quality -f gitlab",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build",
"check-types": "tsc --noemit",
"eslint": "npx eslint src",
"lint": "npm run check-types && npm run eslint",
"lint": "tsc --noemit && npm run eslint",
"lint:fix": "npm run eslint -- --fix",
"prettier": "npx prettier src --check",
"prettier:fix": "npm run prettier -- --write",
"format": "npm run prettier:fix && npm run lint:fix",
"generate-api": "npx @rtk-query/codegen-openapi openapi-config.ts"
"generate-api": "npx @rtk-query/codegen-openapi openapi-config.ts",
"ci:build": "tsc && vite build",
"ci:code-quality": "eslint src --ext .js,.ts,.jsx,.tsx -o eslint/quality -f gitlab"
},
"browserslist": {
"production": [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment