Comments (1)
Upon further testing it appears the .env.production
isn't loaded at all and instead it's loading the .env.development
file.
This is despite it being a Production build. I suspect this is a bug with the package?
Looks like I if I modify the .env.development
or put a .env.development.local
the build message suggests that it will build with the %PUBLIC_URL%
variable:
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "prop-types@^15.6.0".
warning " > [email protected]" has unmet peer dependency "prop-types@^15.6.0".
[4/4] Building fresh packages...
Done in 64.23s.
yarn run v1.22.5
$ CYPRESS_INSTRUMENT_PRODUCTION=true react-scripts -r @cypress/instrument-cra build
Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Compiled successfully.
File sizes after gzip:
131.88 KB build/static/js/2.52b7d34d.chunk.js
41.47 KB (-32 B) build/static/js/main.a675f3a4.chunk.js
1.38 KB build/static/css/2.89e66999.chunk.css
768 B build/static/js/runtime-main.aef01254.js
613 B build/static/css/main.7bb9a71f.chunk.css
The project was built assuming it is hosted at {{.Base}}/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
You may serve it with a static server:
yarn global add serve
serve -s build
Find out more about deployment here:
https://cra.link/deployment
Done in 35.96s.
However it still appears that the static assets generated, specifically the index.html
isn't replacing the variable properly:
Without instrument-cra:
<!doctype html>
<html lang="en">
<head>
<meta property="csp-nonce" content="{{.CSPNonce}}"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="theme-color" content="#000000"/>
<meta name="description" content="Authelia login portal for your apps"/>
<link rel="manifest" href="{{.Base}}/manifest.json"/>
<link rel="icon" href="{{.Base}}/favicon.ico"/>
<title>Login - Authelia</title>
<link href="{{.Base}}/static/css/2.89e66999.chunk.css" rel="stylesheet">
<link href="{{.Base}}/static/css/main.7bb9a71f.chunk.css" rel="stylesheet">
</head>
<body data-basepath="{{.Base}}" data-rememberme="{{.RememberMe}}" data-resetpassword="{{.ResetPassword}}">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="{{.Base}}/static/js/runtime-main.cc5273ce.js"></script><script src="{{.Base}}/static/js/2.4c76f514.chunk.js"></script><script src="{{.Base}}/static/js/main.3f4320b6.chunk.js"></script>
</body>
</html>
With instrument-cra:
<!doctype html>
<html lang="en">
<head>
<meta property="csp-nonce" content="{{.CSPNonce}}"/>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="theme-color" content="#000000"/>
<meta name="description" content="Authelia login portal for your apps"/>
<link rel="manifest" href="/manifest.json"/>
<link rel="icon" href="/favicon.ico"/>
<title>Login - Authelia</title>
<link href="/static/css/2.89e66999.chunk.css" rel="stylesheet">
<link href="/static/css/main.7bb9a71f.chunk.css" rel="stylesheet">
</head>
<body data-basepath="" data-rememberme="{{.RememberMe}}" data-resetpassword="{{.ResetPassword}}">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<script src="/static/js/runtime-main.aef01254.js"></script><script src="/static/js/2.4c76f514.chunk.js"></script><script src="/static/js/main.43db2b5d.chunk.js"></script>
</body>
</html>
from instrument-cra.
Related Issues (20)
- In a Gitlab deployment it is not generating build with -r option
- In a Gitlab build deployment, it gives error webpack is configured only for development env even setting CYPRESS_INSTRUMENT_PRODUCTION=true
- Not able to exclude files from coverage using nyc setup running on a create-react-app application HOT 11
- Does Not Work with CRA v4 HOT 2
- set up good e2e examples HOT 2
- Problem after add @cypressinstrument-cra on a react app HOT 1
- JS files that aren't loaded by webpack are not included in the coverage report HOT 3
- Leading slash is added when using @cypress/instrument-cra for `react-scripts build` with PUBLIC_URL without leading slash defined HOT 2
- https://github.com/strapi/strapi/pull/9387 HOT 1
- Not able to instrument the files which are outside /app folder HOT 2
- alias paths not working with @cypress/instrument-cra
- React-scripts flag vs customize-cra HOT 3
- Build does not generate relative file paths
- Support react-scripts v5 HOT 8
- Yarn workspace support requires hoisted react-scripts HOT 1
- Not working with pnpm HOT 5
- Is this project dead? HOT 3
- How to use -r @cypress/instrument-cra in scripts start?
- dependency for instrument-cra and how to force instrument in production
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instrument-cra.