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
e8ff53f5
Commit
e8ff53f5
authored
May 09, 2017
by
Arunoda Susiripala
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the test app for static export.
parent
450277f2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
130 additions
and
0 deletions
+130
-0
.gitignore
.gitignore
+2
-0
next.config.js
test/integration/static/next.config.js
+12
-0
about.js
test/integration/static/pages/about.js
+12
-0
counter.js
test/integration/static/pages/counter.js
+33
-0
dynamic.js
test/integration/static/pages/dynamic.js
+18
-0
index.js
test/integration/static/pages/index.js
+53
-0
No files found.
.gitignore
View file @
e8ff53f5
...
@@ -12,4 +12,6 @@ npm-debug.log
...
@@ -12,4 +12,6 @@ npm-debug.log
.nyc_output
.nyc_output
coverage
coverage
# test output
test/**/.out
.DS_Store
.DS_Store
test/integration/static/next.config.js
0 → 100644
View file @
e8ff53f5
module
.
exports
=
{
exportPathMap
:
function
()
{
return
{
'/'
:
{
page
:
'/'
},
'/about'
:
{
page
:
'/about'
},
'/counter'
:
{
page
:
'/counter'
},
'/dynamic'
:
{
page
:
'/dynamic'
,
query
:
{
text
:
'cool dynamic text'
}
},
'/dynamic/one'
:
{
page
:
'/dynamic'
,
query
:
{
text
:
'next export is nice'
}
},
'/dynamic/two'
:
{
page
:
'/dynamic'
,
query
:
{
text
:
'zeit is awesome'
}
}
}
}
}
test/integration/static/pages/about.js
0 → 100644
View file @
e8ff53f5
import
Link
from
'next/link'
export
default
()
=>
(
<
div
id
=
'about-page'
>
<
div
>
<
Link
href
=
'/'
>
<
a
>
Go
Back
<
/a
>
<
/Link
>
<
/div
>
<
p
>
This
is
the
About
page
<
/p
>
<
/div
>
)
test/integration/static/pages/counter.js
0 → 100644
View file @
e8ff53f5
import
React
from
'react'
import
Link
from
'next/link'
export
default
class
Counter
extends
React
.
Component
{
constructor
(...
args
)
{
super
(...
args
)
this
.
state
=
{
count
:
0
}
}
increaseCounter
()
{
const
{
count
}
=
this
.
state
this
.
setState
({
count
:
count
+
1
})
}
render
()
{
const
{
count
}
=
this
.
state
return
(
<
div
id
=
'counter-page'
>
<
div
>
<
Link
href
=
'/'
>
<
a
>
Go
Back
<
/a
>
<
/Link
>
<
/div
>
<
p
>
Counter
:
{
count
}
<
/p
>
<
button
onClick
=
{()
=>
this
.
increaseCounter
()}
>
Increase
<
/button
>
<
/div
>
)
}
}
test/integration/static/pages/dynamic.js
0 → 100644
View file @
e8ff53f5
import
Link
from
'next/link'
const
DynamicPage
=
({
text
})
=>
(
<
div
id
=
'about-page'
>
<
div
>
<
Link
href
=
'/'
>
<
a
>
Go
Back
<
/a
>
<
/Link
>
<
/div
>
<
p
>
{
text
}
<
/p
>
<
/div
>
)
DynamicPage
.
getInitialProps
=
({
query
})
=>
{
return
{
text
:
query
.
text
}
}
export
default
DynamicPage
test/integration/static/pages/index.js
0 → 100644
View file @
e8ff53f5
import
Link
from
'next/link'
import
Router
from
'next/router'
function
routeToAbout
(
e
)
{
e
.
preventDefault
()
Router
.
push
(
'/about'
)
}
export
default
()
=>
(
<
div
id
=
'home-page'
>
<
div
>
<
Link
href
=
'/about'
id
=
'about-via-link'
>
<
a
>
About
via
Link
<
/a
>
<
/Link
>
<
a
href
=
'#'
onClick
=
{
routeToAbout
}
id
=
'about-via-router'
>
About
via
Router
<
/a
>
<
Link
href
=
'/counter'
id
=
'counter'
>
<
a
>
Counter
<
/a
>
<
/Link
>
<
Link
href
=
'/dynamic?text=cool+dynamic+text'
id
=
'get-initial-props'
>
<
a
>
getInitialProps
<
/a
>
<
/Link
>
<
Link
href
=
'/dynamic?text=next+export+is+nice'
as
=
'/dynamic/one'
id
=
'dynamic-1'
>
<
a
>
Dynamic
1
<
/a
>
<
/Link
>
<
Link
href
=
'/dynamic?text=zeit+is+awesome'
as
=
'/dynamic/two'
id
=
'dynamic-2'
>
<
a
>
Dynamic
2
<
/a
>
<
/Link
>
<
/div
>
<
p
>
This
is
the
home
page
<
/p
>
<
style
jsx
>
{
`
a {
margin: 0 10px 0 0;
}
`
}
<
/style
>
<
/div
>
)
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