Unverified Commit 918e0a6e authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

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
parent b32763b9
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
"loader-utils": "1.1.0", "loader-utils": "1.1.0",
"minimist": "1.2.0", "minimist": "1.2.0",
"mkdirp-then": "1.2.0", "mkdirp-then": "1.2.0",
"nanoid": "1.2.1",
"path-to-regexp": "2.1.0", "path-to-regexp": "2.1.0",
"prop-types": "15.6.0", "prop-types": "15.6.0",
"prop-types-exact": "1.1.1", "prop-types-exact": "1.1.1",
...@@ -103,7 +104,6 @@ ...@@ -103,7 +104,6 @@
"styled-jsx": "3.0.2", "styled-jsx": "3.0.2",
"unfetch": "3.0.0", "unfetch": "3.0.0",
"url": "0.11.0", "url": "0.11.0",
"uuid": "3.1.0",
"webpack": "4.16.3", "webpack": "4.16.3",
"webpack-dev-middleware": "3.1.3", "webpack-dev-middleware": "3.1.3",
"webpack-hot-middleware": "2.22.2", "webpack-hot-middleware": "2.22.2",
......
// @flow // @flow
import findUp from 'find-up' import findUp from 'find-up'
import uuid from 'uuid'
import {CONFIG_FILE} from '../lib/constants' import {CONFIG_FILE} from '../lib/constants'
type WebpackConfig = * type WebpackConfig = *
...@@ -28,7 +27,11 @@ const defaultConfig: NextConfig = { ...@@ -28,7 +27,11 @@ const defaultConfig: NextConfig = {
assetPrefix: '', assetPrefix: '',
configOrigin: 'default', configOrigin: 'default',
useFileSystemPublicRoutes: true, useFileSystemPublicRoutes: true,
generateBuildId: () => uuid.v4(), generateBuildId: () => {
// nanoid is a small url-safe uuid generator
const nanoid = require('nanoid')
return nanoid()
},
generateEtags: true, generateEtags: true,
pageExtensions: ['jsx', 'js'] pageExtensions: ['jsx', 'js']
} }
......
...@@ -5312,6 +5312,10 @@ nan@^2.10.0, nan@^2.9.2: ...@@ -5312,6 +5312,10 @@ nan@^2.10.0, nan@^2.9.2:
version "2.10.0" version "2.10.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" 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: nanomatch@^1.2.9:
version "1.2.13" version "1.2.13"
resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
...@@ -7853,10 +7857,6 @@ utils-merge@1.0.0: ...@@ -7853,10 +7857,6 @@ utils-merge@1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" 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: uuid@^3.0.0, uuid@^3.1.0, uuid@^3.3.2:
version "3.3.2" version "3.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment