mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 09:55:43 +08:00
Fix process type in TypeScript template (#7796)
This commit is contained in:
committed by
Brody McKee
parent
09cbb89d44
commit
9161ba83d7
@@ -29,7 +29,7 @@ export function register(config?: Config) {
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(
|
||||
(process as { env: { [key: string]: string } }).env.PUBLIC_URL,
|
||||
process.env.PUBLIC_URL,
|
||||
window.location.href
|
||||
);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
|
||||
Reference in New Issue
Block a user