Skip to content

Commit

Permalink
Merge branch 'canary' into update-examples-readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsorban44 committed Mar 16, 2022
2 parents 05848b8 + efdb87d commit 947f5a5
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/next/build/webpack-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ export default async function getBaseWebpackConfig(
},
}
: undefined),
mainFields: !targetWeb ? ['main', 'module'] : ['browser', 'module', 'main'],
mainFields: targetWeb
? (isEdgeRuntime ? [] : ['browser']).concat(['module', 'main'])
: ['main', 'module'],
plugins: [],
}

Expand Down

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.

Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import moment from 'moment'
import nonIsomorphicText from 'non-isomorphic-text'

export default function Page() {
return <div>date:{moment().toString()}</div>
return (
<div>
<div>date:{moment().toString()}</div>
<div>{nonIsomorphicText()}</div>
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ export default function (context, { runtime, env }) {
})
}

it('should not pick browser field from package.json for external libraries', async () => {
const html = await renderViaHTTP(context.appPort, '/external-imports')
expect(html).toContain('isomorphic-export')
})

it('should handle various kinds of exports correctly', async () => {
const html = await renderViaHTTP(context.appPort, '/various-exports')
const content = getNodeBySelector(html, '#__next').text()
Expand Down

0 comments on commit 947f5a5

Please sign in to comment.