Skip to content

Commit

Permalink
disable esm external type
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 23, 2022
1 parent dd8a36d commit b5053ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/next/build/webpack-config.ts
Expand Up @@ -1163,7 +1163,7 @@ export default async function getBaseWebpackConfig(
)
}

const externalType = isEsm ? 'module' : 'commonjs'
const externalType = !hasAppDir && isEsm ? 'module' : 'commonjs'

if (
/next[/\\]dist[/\\]shared[/\\](?!lib[/\\]router[/\\]router)/.test(res) ||
Expand Down
1 change: 1 addition & 0 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -28,6 +28,7 @@ describe('app dir', () => {
next = await createNext({
files: new FileRef(path.join(__dirname, 'app')),
dependencies: {
swr: '2.0.0-rc.0',
react: 'experimental',
'react-dom': 'experimental',
},
Expand Down

0 comments on commit b5053ad

Please sign in to comment.