Skip to content

Commit 729088c

Browse files
committed
Merge branch 'master' of github.com:zeit/next.js
2 parents adf38f3 + ec83670 commit 729088c

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

bin/next-start

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ const dir = resolve(argv._[0] || '.')
4242

4343
const srv = new Server({ dir })
4444

45-
if (!existsSync(resolve(dir, '.next'))) {
46-
console.error(`> Could not find the '.next' directory! Try building your app with 'next build' before starting the server.`)
45+
if (!existsSync(resolve(dir, '.next', 'BUILD_ID'))) {
46+
console.error(`> Could not find a valid build in the '.next' directory! Try building your app with 'next build' before starting the server.`)
4747
process.exit(1)
4848
}
4949

examples/with-react-md/pages/index.js

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Head from 'next/head'
22
import Link from 'next/link'
33

4+
import { PureComponent } from 'react'
5+
46
import Avatar from 'react-md/lib/Avatars'
57
import Button from 'react-md/lib/Buttons/Button'
68
import FontIcon from 'react-md/lib/FontIcons'
@@ -28,17 +30,23 @@ const drawerHeaderChildren = [
2830
/>
2931
]
3032

31-
const NavigationLink = (props) => {
32-
const { href, as, children, ..._props } = props
33-
return (
34-
<div {..._props}>
35-
<Link href={href} as={as}>
36-
<a className='md-list-tile' style={{padding: 0, overflow: 'hidden'}}>
37-
{children}
38-
</a>
39-
</Link>
40-
</div>
41-
)
33+
class NavigationLink extends PureComponent {
34+
// NOTE: Don't try using Stateless (function) component here. `ref` is
35+
// required by React-MD/AccessibleFakeButton, but Stateless components
36+
// don't have one by design:
37+
// https://github.com/facebook/react/issues/4936
38+
render () {
39+
const { href, as, children, ..._props } = this.props
40+
return (
41+
<div {..._props} style={{padding: 0}}>
42+
<Link href={href} as={as}>
43+
<a className='md-list-tile md-list-tile--mini' style={{width: '100%', overflow: 'hidden'}}>
44+
{children}
45+
</a>
46+
</Link>
47+
</div>
48+
)
49+
}
4250
}
4351

4452
export default () => {

server/build/webpack.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,12 @@ export default async function createCompiler (dir, { dev = false, quiet = false
154154
if (!(/\.js$/.test(interpolatedName))) {
155155
return { content, sourceMap }
156156
}
157-
157+
const babelRuntimePath = require.resolve('babel-runtime/package')
158+
.replace(/[\\/]package\.json$/, '')
158159
const transpiled = babelCore.transform(content, {
159160
presets: [require.resolve('babel-preset-es2015')],
160161
sourceMaps: dev ? 'both' : false,
161-
// Here we need to resolve styled-jsx/style to the absolute paths.
162+
// Here we need to resolve all modules to the absolute paths.
162163
// Earlier we did it with the babel-preset.
163164
// But since we don't transpile ES2015 in the preset this is not resolving.
164165
// That's why we need to do it here.
@@ -168,7 +169,16 @@ export default async function createCompiler (dir, { dev = false, quiet = false
168169
require.resolve('babel-plugin-module-resolver'),
169170
{
170171
alias: {
171-
'styled-jsx/style': require.resolve('styled-jsx/style')
172+
'babel-runtime': babelRuntimePath,
173+
react: require.resolve('react'),
174+
'react-dom': require.resolve('react-dom'),
175+
'react-dom/server': require.resolve('react-dom/server'),
176+
'next/link': require.resolve('../../lib/link'),
177+
'next/prefetch': require.resolve('../../lib/prefetch'),
178+
'next/css': require.resolve('../../lib/css'),
179+
'next/head': require.resolve('../../lib/head'),
180+
'next/document': require.resolve('../../server/document'),
181+
'next/router': require.resolve('../../lib/router')
172182
}
173183
}
174184
]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy