mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
7333dd622c
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') }) }) ``` |
||
---|---|---|
.. | ||
integration | ||
isolated | ||
lib | ||
node_modules | ||
unit | ||
.babelrc | ||
.gitignore |