1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/server
Rafał Ruciński 7333dd622c Process available chunk names properly in dev mode (#4604)
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')
      })
    })
```
2018-06-14 11:04:03 +02:00
..
build Add dependencies of _app.js to commons (#4396) 2018-06-07 13:12:48 +02:00
lib Support Node 6 again. check if async/await is supported (#4283) 2018-05-06 18:39:29 +02:00
config.js Add CONFIG_FILE constant, add types for server/config.js (#4529) 2018-06-04 11:38:46 +02:00
document.js Expose app.js (#4129) 2018-04-12 10:33:22 +02:00
export.js Process available chunk names properly in dev mode (#4604) 2018-06-14 11:04:03 +02:00
hot-reloader.js Add check for added/deleted pages (#4497) 2018-05-29 19:32:16 +02:00
index.js Process available chunk names properly in dev mode (#4604) 2018-06-14 11:04:03 +02:00
next.js Programmatic API (#310) 2016-12-16 12:33:08 -08:00
on-demand-entry-handler.js Remove mz-fs and glob-promise (#4026) 2018-03-30 20:29:42 +05:30
render.js Process available chunk names properly in dev mode (#4604) 2018-06-14 11:04:03 +02:00
require.js Clean up references to this.dir and this.dist everywhere (#4535) 2018-06-04 15:45:39 +02:00
router.js Use a latest version of path-to-regexp for path-match (#3655) 2018-02-01 19:54:09 +01:00
utils.js Process available chunk names properly in dev mode (#4604) 2018-06-14 11:04:03 +02:00