-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
test/production/supports-module-resolution-nodenext/pages/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import helloWorldString from 'pkg/sub-export' | ||
|
||
export default function Page() { | ||
return <p>{helloWorldString}</p> | ||
} |
8 changes: 8 additions & 0 deletions
8
test/production/supports-module-resolution-nodenext/pkg/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "pkg", | ||
"version": "1.0.0", | ||
"type": "module", | ||
"exports": { | ||
"./sub-export": "./src/some-file.js" | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
test/production/supports-module-resolution-nodenext/pkg/src/some-file.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare const _default: 'Hello, world' | ||
export default _default |
1 change: 1 addition & 0 deletions
1
test/production/supports-module-resolution-nodenext/pkg/src/some-file.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default 'Hello, world' |
30 changes: 30 additions & 0 deletions
30
...production/supports-module-resolution-nodenext/supports-moduleresolution-nodenext.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createNextDescribe, FileRef } from 'e2e-utils' | ||
import { join } from 'path' | ||
|
||
// regression test suite for https://github.com/vercel/next.js/issues/38854 | ||
createNextDescribe( | ||
'Does not override tsconfig during build', | ||
{ | ||
packageJson: { type: 'module' }, | ||
files: { | ||
'tsconfig.json': new FileRef(join(__dirname, 'tsconfig.json')), | ||
pages: new FileRef(join(__dirname, 'pages')), | ||
pkg: new FileRef(join(__dirname, 'pkg')), | ||
}, | ||
// skipStart: true, | ||
dependencies: { | ||
typescript: 'latest', | ||
'@types/react': 'latest', | ||
'@types/node': 'latest', | ||
pkg: './pkg', | ||
}, | ||
}, | ||
({ next }) => { | ||
it('boots and renders without throwing an error', async () => { | ||
// dummy test for now - not sure why this is failing on `next build`, | ||
// as I can cd into the isolated next install and run `next build` | ||
// without issue... | ||
await next.render$('/') | ||
}) | ||
} | ||
) |