mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
* fixed bug #362, also set chunks names * set simple solution for minChunks * revert in favor of #310
This commit is contained in:
parent
ab14770318
commit
45e36fdff7
|
@ -45,7 +45,7 @@ export default async function createCompiler (dir, { hotReload = false, dev = fa
|
||||||
new webpack.optimize.CommonsChunkPlugin({
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
name: 'commons',
|
name: 'commons',
|
||||||
filename: 'commons.js',
|
filename: 'commons.js',
|
||||||
minChunks: pages.length
|
minChunks: Math.max(2, pages.length)
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ export default class Server {
|
||||||
const p = join(__dirname, '..', 'client', ...(params.path || []))
|
const p = join(__dirname, '..', 'client', ...(params.path || []))
|
||||||
await this.serveStatic(req, res, p)
|
await this.serveStatic(req, res, p)
|
||||||
})
|
})
|
||||||
|
|
||||||
this.router.get('/static/:path+', async (req, res, params) => {
|
this.router.get('/static/:path+', async (req, res, params) => {
|
||||||
const p = join(this.dir, 'static', ...(params.path || []))
|
const p = join(this.dir, 'static', ...(params.path || []))
|
||||||
await this.serveStatic(req, res, p)
|
await this.serveStatic(req, res, p)
|
||||||
|
|
Loading…
Reference in a new issue