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
8b1ea308
Commit
8b1ea308
authored
Mar 29, 2020
by
Guy Bedford
Committed by
Joe Haddad
Mar 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webpack-dev-middleware, webpack-hot-middleware
parent
3621a5d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
86 additions
and
19 deletions
+86
-19
package.json
packages/next/package.json
+3
-3
hot-reloader.ts
packages/next/server/hot-reloader.ts
+2
-2
taskfile-ncc.js
packages/next/taskfile-ncc.js
+4
-8
taskfile.js
packages/next/taskfile.js
+69
-5
misc.d.ts
packages/next/types/misc.d.ts
+8
-1
No files found.
packages/next/package.json
View file @
8b1ea308
...
...
@@ -107,8 +107,6 @@
"use-subscription"
:
"1.1.1"
,
"watchpack"
:
"2.0.0-beta.13"
,
"webpack"
:
"4.42.0"
,
"webpack-dev-middleware"
:
"3.7.0"
,
"webpack-hot-middleware"
:
"2.25.0"
,
"webpack-sources"
:
"1.4.3"
},
"peerDependencies"
:
{
...
...
@@ -199,7 +197,9 @@
"text-table"
:
"0.2.0"
,
"typescript"
:
"3.7.3"
,
"unfetch"
:
"4.1.0"
,
"unistore"
:
"3.4.1"
"unistore"
:
"3.4.1"
,
"webpack-dev-middleware"
:
"3.7.0"
,
"webpack-hot-middleware"
:
"2.25.0"
},
"engines"
:
{
"node"
:
">=10.13.0"
...
...
packages/next/server/hot-reloader.ts
View file @
8b1ea308
...
...
@@ -3,8 +3,8 @@ import { IncomingMessage, ServerResponse } from 'http'
import
{
join
,
normalize
,
relative
as
relativePath
,
sep
}
from
'path'
import
{
UrlObject
}
from
'url'
import
webpack
from
'webpack'
import
WebpackDevMiddleware
from
'webpack-dev-middleware'
import
WebpackHotMiddleware
from
'webpack-hot-middleware'
import
WebpackDevMiddleware
from
'
next/dist/compiled/
webpack-dev-middleware'
import
WebpackHotMiddleware
from
'
next/dist/compiled/
webpack-hot-middleware'
import
{
createEntrypoints
,
createPagesMapping
}
from
'../build/entries'
import
{
watchCompilers
}
from
'../build/output'
import
getBaseWebpackConfig
from
'../build/webpack-config'
...
...
packages/next/taskfile-ncc.js
View file @
8b1ea308
...
...
@@ -6,8 +6,7 @@ module.exports = function(task) {
// eslint-disable-next-line require-yield
task
.
plugin
(
'ncc'
,
{},
function
*
(
file
,
options
)
{
return
ncc
(
join
(
__dirname
,
file
.
dir
,
file
.
base
),
{
// cannot bundle
externals
:
[
'chokidar'
],
filename
:
file
.
base
,
minify
:
true
,
...
options
,
}).
then
(({
code
,
assets
})
=>
{
...
...
@@ -20,7 +19,7 @@ module.exports = function(task) {
)
if
(
options
&&
options
.
packageName
)
{
writePackageManifest
.
call
(
this
,
options
.
packageName
)
writePackageManifest
.
call
(
this
,
options
.
packageName
,
file
.
base
)
}
file
.
data
=
Buffer
.
from
(
code
,
'utf8'
)
...
...
@@ -31,12 +30,9 @@ module.exports = function(task) {
// This function writes a minimal `package.json` file for a compiled package.
// It defines `name`, `main`, `author`, and `license`. It also defines `types`.
// n.b. types intended for development usage only.
function
writePackageManifest
(
packageName
)
{
function
writePackageManifest
(
packageName
,
main
)
{
const
packagePath
=
require
.
resolve
(
packageName
+
'/package.json'
)
let
{
name
,
main
,
author
,
license
}
=
require
(
packagePath
)
if
(
!
main
)
{
main
=
'index.js'
}
let
{
name
,
author
,
license
}
=
require
(
packagePath
)
const
compiledPackagePath
=
join
(
__dirname
,
`dist/compiled/
${
packageName
}
`
)
...
...
packages/next/taskfile.js
View file @
8b1ea308
This diff is collapsed.
Click to expand it.
packages/next/types/misc.d.ts
View file @
8b1ea308
...
...
@@ -196,11 +196,18 @@ declare module 'next/dist/compiled/text-table' {
export
=
textTable
}
declare
module
'next/dist/compiled/unistore'
{
import
m
from
'unistore'
export
=
m
}
declare
module
'next/dist/compiled/webpack-dev-middleware'
{
import
m
from
'webpack-dev-middleware'
export
=
m
}
declare
module
'next/dist/compiled/webpack-hot-middleware'
{
import
m
from
'webpack-hot-middleware'
export
=
m
}
declare
module
'autodll-webpack-plugin'
{
import
webpack
from
'webpack'
...
...
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