* Compile pages to .next/static/<buildid>/pages/<page>
* Fix test
* Export class instead of using exports
* Use constant for static directory
* Add comment about what the middleware does
Fixes#4603.
Tests explain it the best:
```js
describe('development mode (no chunkhash)', () => {
it('should strip the extension from the filename', () => {
const filename = 'foo_bar_0123456789abcdef.js'
expect(getChunkNameFromFilename(filename, true)).toBe('foo_bar_0123456789abcdef')
})
it('should only strip the extension even if there\'s a hyphen in the name', () => {
const filename = 'foo-bar-0123456789abcdef.js'
expect(getChunkNameFromFilename(filename, true)).toBe('foo-bar-0123456789abcdef')
})
})
describe('production mode (with chunkhash)', () => {
it('should strip the hash from the filename', () => {
const filename = 'foo_bar_0123456789abcdef-0123456789abcdef.js'
expect(getChunkNameFromFilename(filename, false)).toBe('foo_bar_0123456789abcdef')
})
it('should only strip the part after the last hyphen in the filename', () => {
const filename = 'foo-bar-0123456789abcdef-0123456789abcdef.js'
expect(getChunkNameFromFilename(filename, false)).toBe('foo-bar-0123456789abcdef')
})
})
```
Previously we called this directory holding the pages/chunks for server rendering `.next/dist` instead of `.next/server` which is confusing both when looking at it and in the codebase, since there's also `distDir` as a configuration option.
Also made this a constant in `next/constants` so functionality using this can be easily found.
* Add build manifest
* Split out css since they don’t have exact name
* Remove pages map
* Fix locations test
* Re-run tests
* Get consistent open ports
* Fix static tests
* Add comment about Cache-Control header
* Initial implementation of next export without exportPathMap
* Shorter message
* Set up flow
* Create pages manifest
* Use pagesManifest for next export
* Fix tests
* Document defaultPathMap
* Replacing the path is no longer needed
* Use posix normalize for consistent behaviour
* Remove second instance of examples
* Add comment about what pages-manifest does
* Make windows path a route
* Removed combine-assets-plugin, since its very broken
* Bundle everything into app.js on production build
* Clean up
* Removed app.js from server routes
* Renamed app.js -> main.js and removed commons from loading
* Remove commons and react CommonChunks
* Removed the commons route
* Killing the entire build-stats hack for app.js
* Removed unused md5-file package
* Add next/config
* Set config on server start / client render
* Add documentation for next/config
* Add next/config support for next export
* Fix test
* Use the correct name
* Set default to empty object on the client side
* Add config tests
* Rename config to runtimeConfig
* Allow next.config.js to export a function
* Expose phases to the configuration function
* Use same value as variable name
* Add next/constants
* Add documentation for config function / phases
* Add constants.js to npm bundle
* Use without .js for the filename.
* Modify the chunk filename to add .js via webpack
* Add import chunk's hash to the filename via webpack.
* Remove buildId from dynamic import urls.
* Make sure next-export work with dynamic imports
* Always fetch pages with '.js' extention from client side.
* Load error page always from _error.js rather _error/index.js
* Load pages from page.js instead of page/index.js from the client for static exports.
* Update index.js
* Simplify the path re-write logic in the webpack pages-plugin.
* allow use of filenames in exportPathMap
* add link test and handling for file paths when flattening links for export
* add note about exporting file paths to readme.md
* Always check with the fs when gettings chunks.
* Add a new set of test cases for dynamic imports in dev.
* Add dynamic import test cases for production.
* Add availableChunks support for static exports.