File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,15 @@ module.exports = function (task) {
25
25
26
26
const isClient = serverOrClient === 'client'
27
27
28
+ /** @type {import('@swc/core').Options } */
28
29
const swcClientOptions = {
29
30
module : {
30
31
type : 'commonjs' ,
31
32
ignoreDynamic : true ,
32
33
} ,
33
34
jsc : {
34
35
loose : true ,
35
-
36
+ externalHelpers : true ,
36
37
target : 'es2016' ,
37
38
parser : {
38
39
syntax : 'typescript' ,
@@ -55,6 +56,7 @@ module.exports = function (task) {
55
56
} ,
56
57
}
57
58
59
+ /** @type {import('@swc/core').Options } */
58
60
const swcServerOptions = {
59
61
module : {
60
62
type : 'commonjs' ,
@@ -67,7 +69,9 @@ module.exports = function (task) {
67
69
} ,
68
70
jsc : {
69
71
loose : true ,
70
-
72
+ // Do not enable external helpers on server-side files build
73
+ // _is_native_funtion helper is not compatible with edge runtime (need investigate)
74
+ externalHelpers : false ,
71
75
parser : {
72
76
syntax : 'typescript' ,
73
77
dynamicImport : true ,
Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ const externals = {
97
97
98
98
'terser-webpack-plugin' :
99
99
'next/dist/build/webpack/plugins/terser-webpack-plugin' ,
100
+
101
+ // TODO: Add @swc /helpers to externals once @vercel /ncc switch to swc-loader
100
102
}
101
103
// eslint-disable-next-line camelcase
102
104
externals [ 'node-html-parser' ] = 'next/dist/compiled/node-html-parser'
You can’t perform that action at this time.
0 commit comments