rsnext/test/production/edge-runtime-is-addressable
Gal Schlezinger 672736c408
[edge] Make runtime addressable in compile time (#38288)
this commit allows to use EdgeRuntime as a dead code eliminator identifier:

```ts
if (typeof EdgeRuntime !== "undefined") {
  console.log("will be stripped away");
} else {
  console.log("will be kept in the bundle");
}
```

which means we're replacing `EdgeRuntime` with a literal

## Related

- Fixes #30739

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-07-04 12:54:07 +00:00
..
index.test.ts [edge] Make runtime addressable in compile time (#38288) 2022-07-04 12:54:07 +00:00