Unverified Commit e260adb8 authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

fix: Enable CJS annotations for next.js files (#48811)

### What?

Enable import/export annotations for next.js files.

### Why?

It's required to allow importing next.js modules from node.
`cjs-module-lexer` needs these annotations to import CJS modules.

### How?

Closes WEB-949
Fixes #48801
parent 7b66e8ae
......@@ -76,7 +76,7 @@
"@opentelemetry/api": "1.4.1",
"@svgr/webpack": "5.5.0",
"@swc/cli": "0.1.55",
"@swc/core": "1.3.51",
"@swc/core": "1.3.55",
"@swc/helpers": "0.5.1",
"@testing-library/react": "13.0.0",
"@types/cheerio": "0.22.16",
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/lib/mock-request.js",
},
start: SourcePos {
line: 21,
line: 26,
column: 56,
},
end: SourcePos {
line: 21,
line: 26,
column: 73,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/api-utils/node.js",
},
start: SourcePos {
line: 25,
line: 30,
column: 17,
},
end: SourcePos {
line: 25,
line: 30,
column: 34,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/api-utils/node.js",
},
start: SourcePos {
line: 149,
line: 154,
column: 20,
},
end: SourcePos {
line: 149,
line: 154,
column: 42,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/crypto-utils.js",
},
start: SourcePos {
line: 18,
line: 22,
column: 56,
},
end: SourcePos {
line: 18,
line: 22,
column: 73,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/api-utils/node.js",
},
start: SourcePos {
line: 25,
line: 30,
column: 17,
},
end: SourcePos {
line: 25,
line: 30,
column: 34,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/crypto-utils.js",
},
start: SourcePos {
line: 18,
line: 22,
column: 56,
},
end: SourcePos {
line: 18,
line: 22,
column: 73,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/api-utils/node.js",
},
start: SourcePos {
line: 149,
line: 154,
column: 20,
},
end: SourcePos {
line: 149,
line: 154,
column: 42,
},
},
......
......@@ -12,11 +12,11 @@ PlainIssue {
ident: "[project]/packages/next/dist/server/lib/mock-request.js",
},
start: SourcePos {
line: 21,
line: 26,
column: 56,
},
end: SourcePos {
line: 21,
line: 26,
column: 73,
},
},
......
......@@ -32,6 +32,7 @@ module.exports = function (task) {
module: {
type: esm ? 'es6' : 'commonjs',
ignoreDynamic: true,
exportInteropAnnotation: true,
},
env: {
targets: MODERN_BROWSERSLIST_TARGET,
......@@ -65,6 +66,7 @@ module.exports = function (task) {
module: {
type: esm ? 'es6' : 'commonjs',
ignoreDynamic: true,
exportInteropAnnotation: true,
},
env: {
targets: {
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment