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
8d84b087
Unverified
Commit
8d84b087
authored
Apr 20, 2021
by
Tim Neutkens
Committed by
GitHub
Apr 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add event for webpack 5 usage (#24222)
parent
239e033b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
0 deletions
+8
-0
index.ts
packages/next/build/index.ts
+2
-0
index.ts
packages/next/export/index.ts
+1
-0
hot-reloader.ts
packages/next/server/hot-reloader.ts
+2
-0
next-dev-server.ts
packages/next/server/next-dev-server.ts
+1
-0
version.ts
packages/next/telemetry/events/version.ts
+2
-0
No files found.
packages/next/build/index.ts
View file @
8d84b087
...
...
@@ -90,6 +90,7 @@ import getBaseWebpackConfig from './webpack-config'
import
{
PagesManifest
}
from
'./webpack/plugins/pages-manifest-plugin'
import
{
writeBuildId
}
from
'./write-build-id'
import
{
normalizeLocalePath
}
from
'../next-server/lib/i18n/normalize-locale-path'
import
{
isWebpack5
}
from
'next/dist/compiled/webpack/webpack'
const
staticCheckWorker
=
require
.
resolve
(
'./utils'
)
...
...
@@ -169,6 +170,7 @@ export default async function build(
telemetry
.
record
(
eventCliSession
(
PHASE_PRODUCTION_BUILD
,
dir
,
{
webpackVersion
:
isWebpack5
?
5
:
4
,
cliCommand
:
'build'
,
isSrcDir
:
path
.
relative
(
dir
,
pagesDir
!
).
startsWith
(
'src'
),
hasNowJson
:
!!
(
await
findUp
(
'now.json'
,
{
cwd
:
dir
})),
...
...
packages/next/export/index.ts
View file @
8d84b087
...
...
@@ -161,6 +161,7 @@ export default async function exportApp(
if
(
telemetry
)
{
telemetry
.
record
(
eventCliSession
(
PHASE_EXPORT
,
distDir
,
{
webpackVersion
:
null
,
cliCommand
:
'export'
,
isSrcDir
:
null
,
hasNowJson
:
!!
(
await
findUp
(
'now.json'
,
{
cwd
:
dir
})),
...
...
packages/next/server/hot-reloader.ts
View file @
8d84b087
...
...
@@ -144,6 +144,7 @@ export default class HotReloader {
private
previewProps
:
__ApiPreviewProps
private
watcher
:
any
private
rewrites
:
CustomRoutes
[
'rewrites'
]
public
isWebpack5
:
any
constructor
(
dir
:
string
,
...
...
@@ -173,6 +174,7 @@ export default class HotReloader {
this
.
config
=
config
this
.
previewProps
=
previewProps
this
.
rewrites
=
rewrites
this
.
isWebpack5
=
isWebpack5
}
public
async
run
(
...
...
packages/next/server/next-dev-server.ts
View file @
8d84b087
...
...
@@ -308,6 +308,7 @@ export default class DevServer extends Server {
const
telemetry
=
new
Telemetry
({
distDir
:
this
.
distDir
})
telemetry
.
record
(
eventCliSession
(
PHASE_DEVELOPMENT_SERVER
,
this
.
distDir
,
{
webpackVersion
:
this
.
hotReloader
.
isWebpack5
?
5
:
4
,
cliCommand
:
'dev'
,
isSrcDir
:
relative
(
this
.
dir
,
this
.
pagesDir
!
).
startsWith
(
'src'
),
hasNowJson
:
!!
(
await
findUp
(
'now.json'
,
{
cwd
:
this
.
dir
})),
...
...
packages/next/telemetry/events/version.ts
View file @
8d84b087
...
...
@@ -32,6 +32,7 @@ type EventCliSessionStarted = {
imageLoader
:
string
|
null
trailingSlashEnabled
:
boolean
reactStrictMode
:
boolean
webpackVersion
:
number
|
null
}
function
hasBabelConfig
(
dir
:
string
):
boolean
{
...
...
@@ -138,6 +139,7 @@ export function eventCliSession(
imageLoader
:
images
?.
loader
,
trailingSlashEnabled
:
!!
userConfiguration
?.
trailingSlash
,
reactStrictMode
:
!!
userConfiguration
?.
reactStrictMode
,
webpackVersion
:
event
.
webpackVersion
||
null
,
}
return
[{
eventName
:
EVENT_VERSION
,
payload
}]
}
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