rsnext/packages/next/shared/lib/isomorphic/path.js
Jiachi Liu e9b423b37c
polish isomorphic path module (#36521)
List all exports for internal path module to avoid import destruction is breaking with typescript.

#### Prev
```js
import pathMod from '../isomorphic/path'

const { join, resolve } = pathMod
```

#### Now
```js
import { join, resolve } from '../isomorphic/path'
```
2022-04-27 18:23:26 +00:00

12 lines
337 B
JavaScript

/**
* This module is for next.js server internal usage of path module.
* It will use native path module for nodejs runtime.
* It will use path-browserify polyfill for edge runtime.
*/
const path =
process.env.NEXT_RUNTIME === 'edge'
? require('next/dist/compiled/path-browserify')
: require('path')
module.exports = path