Skip to content

Commit

Permalink
Add test for serverExternalPackages inside node_modules (#68156)
Browse files Browse the repository at this point in the history
Adds a test for the change in #67948
  • Loading branch information
mischnic authored Jul 30, 2024
1 parent 2c8736a commit 739e0c3
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/e2e/app-dir/app-external/app-external.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ describe('app dir - external dependency', () => {
const $ = await next.render$('/esm/react-namespace-import')
expect($('#namespace-import-esm').text()).toBe('namespace-import:esm')
})

it('should apply serverExternalPackages inside of node_modules', async () => {
const html = await next.render('/transitive-external')
expect(html).toContain('transitive loaded a')
})
})

describe('mixed syntax external modules', () => {
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/app-dir/app-external/app/transitive-external/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { load } from 'transitive'

export default async function Page() {
let value = await load('a')
return <d1iv>{value}</d1iv>
}
6 changes: 5 additions & 1 deletion test/e2e/app-dir/app-external/next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
reactStrictMode: true,
transpilePackages: ['css', 'font', 'transpile-ts-lib', 'transpile-cjs-lib'],
serverExternalPackages: ['conditional-exports-optout', 'dual-pkg-optout'],
serverExternalPackages: [
'conditional-exports-optout',
'dual-pkg-optout',
'transitive-external',
],
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 739e0c3

Please sign in to comment.