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
5493f2e8
Unverified
Commit
5493f2e8
authored
Jul 01, 2019
by
Joe Haddad
Committed by
GitHub
Jul 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Next.js debug mode (#7719)
parent
4ad934c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
27 deletions
+7
-27
router.ts
packages/next-server/lib/router/router.ts
+1
-5
index.ts
packages/next/build/index.ts
+2
-14
webpack-config.ts
packages/next/build/webpack-config.ts
+4
-8
No files found.
packages/next-server/lib/router/router.ts
View file @
5493f2e8
...
@@ -512,11 +512,7 @@ export default class Router implements BaseRouter {
...
@@ -512,11 +512,7 @@ export default class Router implements BaseRouter {
prefetch
(
url
:
string
):
Promise
<
void
>
{
prefetch
(
url
:
string
):
Promise
<
void
>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// Prefetch is not supported in development mode because it would trigger on-demand-entries
// Prefetch is not supported in development mode because it would trigger on-demand-entries
if
(
if
(
process
.
env
.
NODE_ENV
!==
'production'
)
return
process
.
env
.
NODE_ENV
!==
'production'
||
process
.
env
.
__NEXT_EXPERIMENTAL_DEBUG
)
return
const
{
pathname
}
=
parse
(
url
)
const
{
pathname
}
=
parse
(
url
)
// @ts-ignore pathname is always defined
// @ts-ignore pathname is always defined
...
...
packages/next/build/index.ts
View file @
5493f2e8
...
@@ -59,22 +59,12 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -59,22 +59,12 @@ export default async function build(dir: string, conf = null): Promise<void> {
await
verifyTypeScriptSetup
(
dir
)
await
verifyTypeScriptSetup
(
dir
)
const
debug
=
console
.
log
(
'Creating an optimized production build ...'
)
process
.
env
.
__NEXT_BUILDER_EXPERIMENTAL_DEBUG
===
'true'
||
process
.
env
.
__NEXT_BUILDER_EXPERIMENTAL_DEBUG
===
'1'
console
.
log
(
debug
?
'Creating a development build ...'
:
'Creating an optimized production build ...'
)
console
.
log
()
console
.
log
()
const
config
=
loadConfig
(
PHASE_PRODUCTION_BUILD
,
dir
,
conf
)
const
config
=
loadConfig
(
PHASE_PRODUCTION_BUILD
,
dir
,
conf
)
const
{
target
}
=
config
const
{
target
}
=
config
const
buildId
=
debug
const
buildId
=
await
generateBuildId
(
config
.
generateBuildId
,
nanoid
)
?
'unoptimized-build'
:
await
generateBuildId
(
config
.
generateBuildId
,
nanoid
)
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
distDir
=
path
.
join
(
dir
,
config
.
distDir
)
const
pagesDir
=
path
.
join
(
dir
,
'pages'
)
const
pagesDir
=
path
.
join
(
dir
,
'pages'
)
...
@@ -192,7 +182,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -192,7 +182,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
)
)
const
configs
=
await
Promise
.
all
([
const
configs
=
await
Promise
.
all
([
getBaseWebpackConfig
(
dir
,
{
getBaseWebpackConfig
(
dir
,
{
debug
,
buildId
,
buildId
,
isServer
:
false
,
isServer
:
false
,
config
,
config
,
...
@@ -201,7 +190,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -201,7 +190,6 @@ export default async function build(dir: string, conf = null): Promise<void> {
selectivePageBuilding
,
selectivePageBuilding
,
}),
}),
getBaseWebpackConfig
(
dir
,
{
getBaseWebpackConfig
(
dir
,
{
debug
,
buildId
,
buildId
,
isServer
:
true
,
isServer
:
true
,
config
,
config
,
...
...
packages/next/build/webpack-config.ts
View file @
5493f2e8
...
@@ -41,7 +41,6 @@ export default async function getBaseWebpackConfig(
...
@@ -41,7 +41,6 @@ export default async function getBaseWebpackConfig(
dir
:
string
,
dir
:
string
,
{
{
dev
=
false
,
dev
=
false
,
debug
=
false
,
isServer
=
false
,
isServer
=
false
,
buildId
,
buildId
,
config
,
config
,
...
@@ -50,7 +49,6 @@ export default async function getBaseWebpackConfig(
...
@@ -50,7 +49,6 @@ export default async function getBaseWebpackConfig(
selectivePageBuilding
=
false
,
selectivePageBuilding
=
false
,
}:
{
}:
{
dev
?:
boolean
dev
?:
boolean
debug
?:
boolean
isServer
?:
boolean
isServer
?:
boolean
buildId
:
string
buildId
:
string
config
:
any
config
:
any
...
@@ -177,7 +175,7 @@ export default async function getBaseWebpackConfig(
...
@@ -177,7 +175,7 @@ export default async function getBaseWebpackConfig(
},
},
}
}
const
devtool
=
dev
||
debug
?
'cheap-module-source-map'
:
false
const
devtool
=
dev
?
'cheap-module-source-map'
:
false
let
webpackConfig
:
webpack
.
Configuration
=
{
let
webpackConfig
:
webpack
.
Configuration
=
{
devtool
,
devtool
,
...
@@ -298,8 +296,8 @@ export default async function getBaseWebpackConfig(
...
@@ -298,8 +296,8 @@ export default async function getBaseWebpackConfig(
},
},
},
},
},
},
minimize
:
!
(
dev
||
debug
)
,
minimize
:
!
dev
,
minimizer
:
!
(
dev
||
debug
)
minimizer
:
!
dev
?
[
?
[
new
TerserPlugin
({
new
TerserPlugin
({
...
terserPluginConfig
,
...
terserPluginConfig
,
...
@@ -373,8 +371,7 @@ export default async function getBaseWebpackConfig(
...
@@ -373,8 +371,7 @@ export default async function getBaseWebpackConfig(
strictExportPresence
:
true
,
strictExportPresence
:
true
,
rules
:
[
rules
:
[
(
selectivePageBuilding
||
config
.
experimental
.
terserLoader
)
&&
(
selectivePageBuilding
||
config
.
experimental
.
terserLoader
)
&&
!
isServer
&&
!
isServer
&&
{
!
debug
&&
{
test
:
/
\.(
js|mjs|jsx
)
$/
,
test
:
/
\.(
js|mjs|jsx
)
$/
,
exclude
:
/
\.
min
\.(
js|mjs|jsx
)
$/
,
exclude
:
/
\.
min
\.(
js|mjs|jsx
)
$/
,
use
:
{
use
:
{
...
@@ -443,7 +440,6 @@ export default async function getBaseWebpackConfig(
...
@@ -443,7 +440,6 @@ export default async function getBaseWebpackConfig(
'process.env.__NEXT_DIST_DIR'
:
JSON
.
stringify
(
distDir
),
'process.env.__NEXT_DIST_DIR'
:
JSON
.
stringify
(
distDir
),
}
}
:
{}),
:
{}),
'process.env.__NEXT_EXPERIMENTAL_DEBUG'
:
JSON
.
stringify
(
debug
),
'process.env.__NEXT_EXPORT_TRAILING_SLASH'
:
JSON
.
stringify
(
'process.env.__NEXT_EXPORT_TRAILING_SLASH'
:
JSON
.
stringify
(
config
.
experimental
.
exportTrailingSlash
config
.
experimental
.
exportTrailingSlash
),
),
...
...
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