mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Merge master into next-export.
This commit is contained in:
commit
55c7553a98
9
examples/with-react-md/next.config.js
Normal file
9
examples/with-react-md/next.config.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
module.exports = {
|
||||
webpack: function (config) {
|
||||
if (config.resolve.alias) {
|
||||
delete config.resolve.alias['react']
|
||||
delete config.resolve.alias['react-dom']
|
||||
}
|
||||
return config
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
{
|
||||
"presets": [
|
||||
"next/babel",
|
||||
"stage-0"
|
||||
"next/babel"
|
||||
],
|
||||
"plugins": [
|
||||
["styled-components", { "ssr": true, "displayName": true, "preprocess": false } ]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
"mz": "2.6.0",
|
||||
"path-match": "1.2.4",
|
||||
"pkg-up": "2.0.0",
|
||||
"prop-types": "15.5.9",
|
||||
"prop-types": "15.5.10",
|
||||
"react-hot-loader": "3.0.0-beta.6",
|
||||
"send": "0.15.2",
|
||||
"source-map-support": "0.4.15",
|
||||
|
@ -96,7 +96,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "7.2.3",
|
||||
"babel-jest": "18.0.0",
|
||||
"babel-jest": "20.0.1",
|
||||
"babel-plugin-istanbul": "4.1.3",
|
||||
"babel-plugin-transform-remove-strict-mode": "0.0.2",
|
||||
"babel-preset-es2015": "6.24.1",
|
||||
|
@ -106,13 +106,14 @@
|
|||
"coveralls": "2.13.1",
|
||||
"cross-env": "4.0.0",
|
||||
"express": "4.15.2",
|
||||
"cross-env": "5.0.0",
|
||||
"fly": "2.0.6",
|
||||
"fly-babel": "2.1.1",
|
||||
"fly-clear": "1.0.1",
|
||||
"fly-esnext": "2.0.1",
|
||||
"fly-watch": "1.1.1",
|
||||
"husky": "0.13.3",
|
||||
"jest-cli": "19.0.1",
|
||||
"jest-cli": "20.0.1",
|
||||
"lint-staged": "^3.4.0",
|
||||
"node-fetch": "1.6.3",
|
||||
"node-notifier": "5.1.2",
|
||||
|
|
12
readme.md
12
readme.md
|
@ -683,9 +683,15 @@ In order to extend our usage of `webpack`, you can define a function that extend
|
|||
|
||||
module.exports = {
|
||||
webpack: (config, { dev }) => {
|
||||
// Perform customizations to config
|
||||
|
||||
// Important: return the modified config
|
||||
// Perform customizations to webpack config
|
||||
|
||||
// Important: return the modified config
|
||||
return config
|
||||
},
|
||||
webpackDevMiddleware: (config) => {
|
||||
// Perform customizations to webpack dev middleware config
|
||||
|
||||
// Important: return the modified config
|
||||
return config
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ const cache = new Map()
|
|||
|
||||
const defaultConfig = {
|
||||
webpack: null,
|
||||
webpackDevMiddleware: null,
|
||||
poweredByHeader: true,
|
||||
distDir: '.next',
|
||||
assetPrefix: ''
|
||||
|
|
|
@ -138,14 +138,21 @@ export default class HotReloader {
|
|||
}
|
||||
} : {}
|
||||
|
||||
this.webpackDevMiddleware = webpackDevMiddleware(compiler, {
|
||||
let webpackDevMiddlewareConfig = {
|
||||
publicPath: '/_next/webpack/',
|
||||
noInfo: true,
|
||||
quiet: true,
|
||||
clientLogLevel: 'warning',
|
||||
watchOptions: { ignored },
|
||||
...windowsSettings
|
||||
})
|
||||
}
|
||||
|
||||
if (this.config.webpackDevMiddleware) {
|
||||
console.log('> Using "webpackDevMiddleware" config function defined in next.config.js.')
|
||||
webpackDevMiddlewareConfig = this.config.webpackDevMiddleware(webpackDevMiddlewareConfig)
|
||||
}
|
||||
|
||||
this.webpackDevMiddleware = webpackDevMiddleware(compiler, webpackDevMiddlewareConfig)
|
||||
|
||||
this.webpackHotMiddleware = webpackHotMiddleware(compiler, {
|
||||
path: '/_next/webpack-hmr',
|
||||
|
|
Loading…
Reference in a new issue