I have an app created with create-react-app. The app works fine when served using npm run start
.
Now, when built using npm run build
, some CSS seems missing. I also observe that build/static/css/main.38396655.css
contains an @import
to a third-party server. Namely for Esri's Calcite Components: @import url("https://js.arcgis.com/4.25/@arcgis/core/assets/esri/themes/light/main.css")
.
Furthermore, the Network tab in Chrome's dev tools does not show any request for that imported file. I also get no 404 or anything if I replace it by a non-existing URL.
Two questions regarding this:
- Does this external import actually cause the missing CSS?
- If so, how can I force the build script to include this CSS in the built package?
As requested, here also the package.json
:
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@arcgis/core": "^4.25.5",
"@esri/calcite-components": "^1.0.5",
"@esri/calcite-components-react": "^0.35.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"proxy": "http://localhost:8080/",
"homepage": ".",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}