chore(v2): use single method package instead of whole Lodash package in blog plugin (#2460)

This commit is contained in:
Bartosz Kaszubowski 2020-03-25 11:28:27 +01:00 committed by GitHub
parent 16a84998da
commit 85c124e3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -20,7 +20,7 @@
"fs-extra": "^8.1.0",
"globby": "^10.0.1",
"loader-utils": "^1.2.3",
"lodash": "^4.17.15"
"lodash.kebabcase": "^4.1.1"
},
"peerDependencies": {
"@docusaurus/core": "^2.0.0",

View file

@ -6,7 +6,7 @@
*/
import fs from 'fs-extra';
import _ from 'lodash';
import kebabCase from 'lodash.kebabcase';
import path from 'path';
import {normalizeUrl, docuHash, aliasedSitePath} from '@docusaurus/utils';
@ -167,7 +167,7 @@ export default function pluginContentBlog(
// eslint-disable-next-line no-param-reassign
blogPost.metadata.tags = tags.map(tag => {
if (typeof tag === 'string') {
const normalizedTag = _.kebabCase(tag);
const normalizedTag = kebabCase(tag);
const permalink = normalizeUrl([tagsPath, normalizedTag]);
if (!blogTags[normalizedTag]) {
blogTags[normalizedTag] = {