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
61de215e
Unverified
Commit
61de215e
authored
Feb 20, 2019
by
Connor Davis
Committed by
GitHub
Feb 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move webpack config to TypeScript (#6348)
parent
0bf5041e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
3524 additions
and
1391 deletions
+3524
-1391
.travis.yml
.travis.yml
+3
-1
store.js
examples/with-mobx/store.js
+1
-1
package.json
package.json
+3
-3
package.json
packages/next-server/package.json
+2
-2
entries.ts
packages/next/build/entries.ts
+1
-1
index.ts
packages/next/build/index.ts
+1
-1
webpack-config.ts
packages/next/build/webpack-config.ts
+129
-154
package.json
packages/next/package.json
+2
-1
index.d.ts
packages/next/types/index.d.ts
+21
-1
webpack.d.ts
packages/next/types/webpack.d.ts
+1885
-0
yarn.lock
yarn.lock
+1476
-1226
No files found.
.travis.yml
View file @
61de215e
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
directories
:
[
"
node_modules"
]
directories
:
[
"
node_modules"
]
},
},
before_install
:
[
before_install
:
[
"
curl
-o-
-L
https://yarnpkg.com/install.sh
|
bash"
,
"
export
PATH=
\"
$HOME/.yarn/bin:$PATH
\"
"
,
"
export
DISPLAY=:99.0"
,
"
export
DISPLAY=:99.0"
,
"
sh
-e
/etc/init.d/xvfb
start"
,
"
sh
-e
/etc/init.d/xvfb
start"
,
"
sleep
3"
"
sleep
3"
...
@@ -21,5 +23,5 @@
...
@@ -21,5 +23,5 @@
"
rm
-rf
node_modules/.cache"
"
rm
-rf
node_modules/.cache"
],
],
before_script
:
[],
before_script
:
[],
after_script
:
[
"
npm
run
coveralls"
]
after_script
:
[
"
yarn
run
coveralls"
]
}
}
examples/with-mobx/store.js
View file @
61de215e
...
@@ -26,7 +26,7 @@ class Store {
...
@@ -26,7 +26,7 @@ class Store {
let
store
=
null
let
store
=
null
export
function
initializeStore
(
initialData
)
{
export
function
initializeStore
(
initialData
)
{
// Always make a new store if server, otherwise state is shared between requests
// Always make a new store if server, otherwise state is shared between requests
if
(
isServer
)
{
if
(
isServer
)
{
return
new
Store
(
isServer
,
initialData
)
return
new
Store
(
isServer
,
initialData
)
...
...
package.json
View file @
61de215e
...
@@ -8,9 +8,9 @@
...
@@ -8,9 +8,9 @@
"lerna"
:
"lerna"
,
"lerna"
:
"lerna"
,
"dev"
:
"lerna run build --stream --parallel"
,
"dev"
:
"lerna run build --stream --parallel"
,
"testonly"
:
"jest"
,
"testonly"
:
"jest"
,
"testall"
:
"yarn check &&
npm
run testonly -- --coverage --forceExit --runInBand --reporters=default --reporters=jest-junit"
,
"testall"
:
"yarn check &&
yarn
run testonly -- --coverage --forceExit --runInBand --reporters=default --reporters=jest-junit"
,
"pretest"
:
"
npm
run lint"
,
"pretest"
:
"
yarn
run lint"
,
"test"
:
"
npm run testall || npm
run testall"
,
"test"
:
"
yarn run testall || yarn
run testall"
,
"coveralls"
:
"cat ./test/coverage/lcov.info | coveralls"
,
"coveralls"
:
"cat ./test/coverage/lcov.info | coveralls"
,
"lint"
:
"lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint"
:
"lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint-fix"
:
"standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
"lint-fix"
:
"standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts"
,
...
...
packages/next-server/package.json
View file @
61de215e
...
@@ -42,8 +42,8 @@
...
@@ -42,8 +42,8 @@
"devDependencies"
:
{
"devDependencies"
:
{
"@taskr/clear"
:
"1.1.0"
,
"@taskr/clear"
:
"1.1.0"
,
"@taskr/watch"
:
"1.1.0"
,
"@taskr/watch"
:
"1.1.0"
,
"@types/react"
:
"16.
7.13
"
,
"@types/react"
:
"16.
8.4
"
,
"@types/react-dom"
:
"16.
0.11
"
,
"@types/react-dom"
:
"16.
8.2
"
,
"@types/react-is"
:
"16.5.0"
,
"@types/react-is"
:
"16.5.0"
,
"@types/send"
:
"0.14.4"
,
"@types/send"
:
"0.14.4"
,
"taskr"
:
"1.1.0"
,
"taskr"
:
"1.1.0"
,
...
...
packages/next/build/entries.ts
View file @
61de215e
...
@@ -21,7 +21,7 @@ export function createPagesMapping(pagePaths: string[], extensions: string[]): P
...
@@ -21,7 +21,7 @@ export function createPagesMapping(pagePaths: string[], extensions: string[]): P
return
pages
return
pages
}
}
type
WebpackEntrypoints
=
{
export
type
WebpackEntrypoints
=
{
[
bundle
:
string
]:
string
|
string
[]
[
bundle
:
string
]:
string
|
string
[]
}
}
...
...
packages/next/build/index.ts
View file @
61de215e
...
@@ -58,7 +58,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -58,7 +58,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
const
pagePaths
=
await
collectPages
(
pagesDir
,
config
.
pageExtensions
)
const
pagePaths
=
await
collectPages
(
pagesDir
,
config
.
pageExtensions
)
const
pages
=
createPagesMapping
(
pagePaths
,
config
.
pageExtensions
)
const
pages
=
createPagesMapping
(
pagePaths
,
config
.
pageExtensions
)
const
entrypoints
=
createEntrypoints
(
pages
,
config
.
target
,
buildId
,
config
)
const
entrypoints
=
createEntrypoints
(
pages
,
config
.
target
,
buildId
,
config
)
const
configs
:
any
=
[
const
configs
=
[
getBaseWebpackConfig
(
dir
,
{
getBaseWebpackConfig
(
dir
,
{
buildId
,
buildId
,
isServer
:
false
,
isServer
:
false
,
...
...
packages/next/build/webpack-config.
j
s
→
packages/next/build/webpack-config.
t
s
View file @
61de215e
This diff is collapsed.
Click to expand it.
packages/next/package.json
View file @
61de215e
...
@@ -111,6 +111,7 @@
...
@@ -111,6 +111,7 @@
"@types/babel__generator"
:
"7.0.1"
,
"@types/babel__generator"
:
"7.0.1"
,
"@types/babel__template"
:
"7.0.1"
,
"@types/babel__template"
:
"7.0.1"
,
"@types/babel__traverse"
:
"7.0.3"
,
"@types/babel__traverse"
:
"7.0.3"
,
"@types/case-sensitive-paths-webpack-plugin"
:
"2.1.2"
,
"@types/cross-spawn"
:
"6.0.0"
,
"@types/cross-spawn"
:
"6.0.0"
,
"@types/etag"
:
"1.8.0"
,
"@types/etag"
:
"1.8.0"
,
"@types/fresh"
:
"0.5.0"
,
"@types/fresh"
:
"0.5.0"
,
...
@@ -119,9 +120,9 @@
...
@@ -119,9 +120,9 @@
"@types/mkdirp"
:
"0.5.2"
,
"@types/mkdirp"
:
"0.5.2"
,
"@types/nanoid"
:
"1.2.0"
,
"@types/nanoid"
:
"1.2.0"
,
"@types/node-fetch"
:
"2.1.4"
,
"@types/node-fetch"
:
"2.1.4"
,
"@types/resolve"
:
"0.0.8"
,
"@types/rimraf"
:
"2.0.2"
,
"@types/rimraf"
:
"2.0.2"
,
"@types/signal-exit"
:
"3.0.0"
,
"@types/signal-exit"
:
"3.0.0"
,
"@types/webpack"
:
"4.4.22"
,
"taskr"
:
"1.1.0"
,
"taskr"
:
"1.1.0"
,
"typescript"
:
"3.1.6"
"typescript"
:
"3.1.6"
},
},
...
...
packages/next/types/index.d.ts
View file @
61de215e
...
@@ -25,4 +25,24 @@ declare module 'arg' {
...
@@ -25,4 +25,24 @@ declare module 'arg' {
}
}
export
=
arg
;
export
=
arg
;
}
}
\ No newline at end of file
declare
module
'autodll-webpack-plugin'
{
import
webpack
from
'webpack'
class
AutoDllPlugin
implements
webpack
.
Plugin
{
constructor
(
settings
?:
{
inject
?:
boolean
,
plugins
?:
webpack
.
Configuration
[
"plugins"
],
context
?:
string
,
debug
?:
boolean
,
filename
?:
string
,
path
?:
string
,
inherit
?:
boolean
,
entry
?:
webpack
.
Entry
,
config
?:
webpack
.
Configuration
})
apply
:
webpack
.
Plugin
[
"apply"
]
[
k
:
string
]:
any
}
export
=
AutoDllPlugin
}
packages/next/types/webpack.d.ts
0 → 100644
View file @
61de215e
This diff is collapsed.
Click to expand it.
yarn.lock
View file @
61de215e
This diff is collapsed.
Click to expand it.
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