Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
9247c901
Unverified
Commit
9247c901
authored
Feb 22, 2019
by
Tim Neutkens
Committed by
GitHub
Feb 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove http-status dependency (#6405)
parent
b88addfc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
webpack-config.ts
packages/next/build/webpack-config.ts
+1
-1
package.json
packages/next/package.json
+0
-1
_error.js
packages/next/pages/_error.js
+8
-5
yarn.lock
yarn.lock
+0
-5
No files found.
packages/next/build/webpack-config.ts
View file @
9247c901
...
...
@@ -83,7 +83,7 @@ export default function getBaseWebpackConfig (dir: string, {dev = false, isServe
target
:
isServer
?
'node'
:
'web'
,
externals
:
isServer
&&
target
!==
'serverless'
?
[
(
context
,
request
,
callback
)
=>
{
const
notExternalModules
=
[
'next/app'
,
'next/document'
,
'next/link'
,
'next/router'
,
'next/error'
,
'
http-status'
,
'
string-hash'
,
'hoist-non-react-statics'
,
'htmlescape'
]
const
notExternalModules
=
[
'next/app'
,
'next/document'
,
'next/link'
,
'next/router'
,
'next/error'
,
'string-hash'
,
'hoist-non-react-statics'
,
'htmlescape'
]
if
(
notExternalModules
.
indexOf
(
request
)
!==
-
1
)
{
return
callback
()
...
...
packages/next/package.json
View file @
9247c901
...
...
@@ -67,7 +67,6 @@
"fresh"
:
"0.5.2"
,
"glob"
:
"7.1.2"
,
"hoist-non-react-statics"
:
"3.2.0"
,
"http-status"
:
"1.0.1"
,
"launch-editor"
:
"2.2.1"
,
"loader-utils"
:
"1.1.0"
,
"mkdirp-then"
:
"1.2.0"
,
...
...
packages/next/pages/_error.js
View file @
9247c901
import
React
from
'react'
import
PropTypes
from
'prop-types'
import
HTTPStatus
from
'http-status'
import
Head
from
'next-server/head'
const
statusCodes
=
{
400
:
'Bad Request'
,
404
:
'This page could not be found'
,
500
:
'Internal Server Error'
,
501
:
'Not Implemented'
}
export
default
class
Error
extends
React
.
Component
{
static
displayName
=
'ErrorPage'
...
...
@@ -14,10 +20,7 @@ export default class Error extends React.Component {
render
()
{
const
{
statusCode
}
=
this
.
props
const
title
=
statusCode
===
404
?
'This page could not be found'
:
HTTPStatus
[
statusCode
]
||
'An unexpected error has occurred'
const
title
=
statusCodes
[
statusCode
]
||
'An unexpected error has occurred'
return
(
<
div
style
=
{
styles
.
error
}
>
...
...
yarn.lock
View file @
9247c901
...
...
@@ -6103,11 +6103,6 @@ http-signature@~1.2.0:
jsprim "^1.2.2"
sshpk "^1.7.0"
http-status@1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/http-status/-/http-status-1.0.1.tgz#dc43001a8bfc50ac87d485a892f7578964bc94a2"
integrity sha1-3EMAGov8UKyH1IWokvdXiWS8lKI=
https-browserify@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment