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
36164ead
Unverified
Commit
36164ead
authored
Dec 31, 2018
by
Tim Neutkens
Committed by
GitHub
Dec 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don’t bundle next/asset if it’s not used (#5971)
parent
20fe65ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
4 deletions
+1
-4
asset.js
packages/next-server/lib/asset.js
+1
-1
index.js
packages/next/client/index.js
+0
-3
No files found.
packages/next-server/lib/asset.js
View file @
36164ead
let
assetPrefix
let
assetPrefix
=
typeof
window
!==
'undefined'
?
(
window
.
__NEXT_DATA__
.
assetPrefix
)
:
undefined
export
default
function
asset
(
path
)
{
export
default
function
asset
(
path
)
{
// If the URL starts with http, we assume it's an
// If the URL starts with http, we assume it's an
...
...
packages/next/client/index.js
View file @
36164ead
...
@@ -5,7 +5,6 @@ import { createRouter } from 'next/router'
...
@@ -5,7 +5,6 @@ import { createRouter } from 'next/router'
import
EventEmitter
from
'next-server/dist/lib/event-emitter'
import
EventEmitter
from
'next-server/dist/lib/event-emitter'
import
{
loadGetInitialProps
,
getURL
}
from
'next-server/dist/lib/utils'
import
{
loadGetInitialProps
,
getURL
}
from
'next-server/dist/lib/utils'
import
PageLoader
from
'./page-loader'
import
PageLoader
from
'./page-loader'
import
*
as
asset
from
'next-server/asset'
import
*
as
envConfig
from
'next-server/config'
import
*
as
envConfig
from
'next-server/config'
import
ErrorBoundary
from
'./error-boundary'
import
ErrorBoundary
from
'./error-boundary'
import
Loadable
from
'next-server/dist/lib/loadable'
import
Loadable
from
'next-server/dist/lib/loadable'
...
@@ -38,8 +37,6 @@ const prefix = assetPrefix || ''
...
@@ -38,8 +37,6 @@ const prefix = assetPrefix || ''
// With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
// With dynamic assetPrefix it's no longer possible to set assetPrefix at the build time
// So, this is how we do it in the client side at runtime
// So, this is how we do it in the client side at runtime
__webpack_public_path__
=
`
${
prefix
}
/_next/`
//eslint-disable-line
__webpack_public_path__
=
`
${
prefix
}
/_next/`
//eslint-disable-line
// Initialize next/asset with the assetPrefix
asset
.
setAssetPrefix
(
prefix
)
// Initialize next/config with the environment configuration
// Initialize next/config with the environment configuration
envConfig
.
setConfig
({
envConfig
.
setConfig
({
serverRuntimeConfig
:
{},
serverRuntimeConfig
:
{},
...
...
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