1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Replace uuid with nanoid (#4987)

* Replace uuid with nanoid

Same functionality in a smaller package:

https://bundlephobia.com/result?p=nanoid@1.2.1
https://bundlephobia.com/result?p=uuid@3.3.2

* Add comment
This commit is contained in:
Tim Neutkens 2018-08-23 17:02:47 +02:00 committed by GitHub
parent b32763b9e3
commit 918e0a6e32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -89,6 +89,7 @@
"loader-utils": "1.1.0",
"minimist": "1.2.0",
"mkdirp-then": "1.2.0",
"nanoid": "1.2.1",
"path-to-regexp": "2.1.0",
"prop-types": "15.6.0",
"prop-types-exact": "1.1.1",
@ -103,7 +104,6 @@
"styled-jsx": "3.0.2",
"unfetch": "3.0.0",
"url": "0.11.0",
"uuid": "3.1.0",
"webpack": "4.16.3",
"webpack-dev-middleware": "3.1.3",
"webpack-hot-middleware": "2.22.2",

View file

@ -1,6 +1,5 @@
// @flow
import findUp from 'find-up'
import uuid from 'uuid'
import {CONFIG_FILE} from '../lib/constants'
type WebpackConfig = *
@ -28,7 +27,11 @@ const defaultConfig: NextConfig = {
assetPrefix: '',
configOrigin: 'default',
useFileSystemPublicRoutes: true,
generateBuildId: () => uuid.v4(),
generateBuildId: () => {
// nanoid is a small url-safe uuid generator
const nanoid = require('nanoid')
return nanoid()
},
generateEtags: true,
pageExtensions: ['jsx', 'js']
}

View file

@ -5312,6 +5312,10 @@ nan@^2.10.0, nan@^2.9.2:
version "2.10.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"
nanoid@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-1.2.1.tgz#922bf6c10e35f7b208993768dad643577c907adf"
nanomatch@^1.2.9:
version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
@ -7853,10 +7857,6 @@ utils-merge@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8"
uuid@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
uuid@^3.0.0, uuid@^3.1.0, uuid@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"