Skip to content

Commit 9124d74

Browse files
committed
omit propsal-dynamic-import
1 parent e2cc5fc commit 9124d74

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

packages/next/client/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export function renderError(renderErrorProps: RenderErrorProps): Promise<any> {
468468
.loadPage('/_error')
469469
.then(({ page: ErrorComponent, styleSheets }) => {
470470
return lastAppProps?.Component === ErrorComponent
471-
? import('next/dist/pages/_error').then((m) => ({
471+
? import('../pages/_error').then((m) => ({
472472
ErrorComponent: m.default as React.ComponentType<{}>,
473473
styleSheets: [],
474474
}))

packages/next/taskfile-babel.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ const path = require('path')
66
// eslint-disable-next-line import/no-extraneous-dependencies
77
const transform = require('@babel/core').transform
88

9-
const clientPath = path.resolve(__dirname, 'client')
10-
119
const babelClientPresetEnvOptions = {
1210
modules: 'commonjs',
1311
targets: {
@@ -20,6 +18,7 @@ const babelClientPresetEnvOptions = {
2018
'transform-typeof-symbol',
2119
'transform-async-to-generator',
2220
'transform-spread',
21+
'proposal-dynamic-import',
2322
],
2423
}
2524

@@ -41,15 +40,6 @@ const babelClientOpts = {
4140
// eslint-disable-next-line import/no-extraneous-dependencies
4241
plugins: [require('@babel/plugin-proposal-numeric-separator').default],
4342
},
44-
{
45-
test: (p) => p.startsWith(clientPath),
46-
presets: [
47-
[
48-
'@babel/preset-env',
49-
{ ...babelClientPresetEnvOptions, modules: false },
50-
],
51-
],
52-
},
5343
],
5444
}
5545

packages/next/types/misc.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ declare module 'next/dist/compiled/arg/index.js' {
4545
export = arg
4646
}
4747

48-
declare module 'next/dist/pages/_error'
49-
5048
declare module 'next/dist/compiled/babel/code-frame' {
5149
export * from '@babel/code-frame'
5250
}

test/integration/build-output/test/index.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,16 @@ describe('Build Output', () => {
123123
)
124124
expect(indexSize.endsWith('B')).toBe(true)
125125

126-
expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 64 : 196, 1)
126+
expect(parseFloat(indexFirstLoad)).toBeCloseTo(gz ? 64.7 : 198, 1)
127127
expect(indexFirstLoad.endsWith('kB')).toBe(true)
128128

129129
expect(parseFloat(err404Size)).toBeCloseTo(gz ? 3.17 : 8.51, 1)
130130
expect(err404Size.endsWith('kB')).toBe(true)
131131

132-
expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 66.9 : 205, 1)
132+
expect(parseFloat(err404FirstLoad)).toBeCloseTo(gz ? 67.6 : 206, 1)
133133
expect(err404FirstLoad.endsWith('kB')).toBe(true)
134134

135-
expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 63.7 : 196, 1)
135+
expect(parseFloat(sharedByAll)).toBeCloseTo(gz ? 64.5 : 198, 1)
136136
expect(sharedByAll.endsWith('kB')).toBe(true)
137137

138138
const appSizeValue = _appSize.endsWith('kB')
@@ -144,12 +144,12 @@ describe('Build Output', () => {
144144
const webpackSizeValue = webpackSize.endsWith('kB')
145145
? parseFloat(webpackSize)
146146
: parseFloat(webpackSize) / 1000
147-
expect(webpackSizeValue).toBeCloseTo(gz ? 0.766 : 1.46, 2)
147+
expect(webpackSizeValue).toBeCloseTo(gz ? 1.42 : 2.9, 2)
148148
expect(webpackSize.endsWith('kB') || webpackSize.endsWith(' B')).toBe(
149149
true
150150
)
151151

152-
expect(parseFloat(mainSize)).toBeCloseTo(gz ? 20.1 : 62.7, 1)
152+
expect(parseFloat(mainSize)).toBeCloseTo(gz ? 20.2 : 63, 1)
153153
expect(mainSize.endsWith('kB')).toBe(true)
154154

155155
expect(parseFloat(frameworkSize)).toBeCloseTo(gz ? 42.0 : 130, 1)

0 commit comments

Comments
 (0)