From fd370392df2045f0a15ee8066765ed68cba9097b Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 18 Mar 2021 23:13:18 -0400 Subject: [PATCH 1/3] Remove lodash/chunk --- packages/babel-helper-module-transforms/package.json | 3 +-- packages/babel-helper-module-transforms/src/index.js | 9 ++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/babel-helper-module-transforms/package.json b/packages/babel-helper-module-transforms/package.json index 8a5b44ca27a1..99b1ea92d09d 100644 --- a/packages/babel-helper-module-transforms/package.json +++ b/packages/babel-helper-module-transforms/package.json @@ -22,7 +22,6 @@ "@babel/helper-validator-identifier": "workspace:^7.12.11", "@babel/template": "workspace:^7.12.13", "@babel/traverse": "workspace:^7.13.0", - "@babel/types": "workspace:^7.13.0", - "lodash": "^4.17.19" + "@babel/types": "workspace:^7.13.0" } } diff --git a/packages/babel-helper-module-transforms/src/index.js b/packages/babel-helper-module-transforms/src/index.js index 5e244e2ab2f1..e1fb820106c6 100644 --- a/packages/babel-helper-module-transforms/src/index.js +++ b/packages/babel-helper-module-transforms/src/index.js @@ -1,7 +1,6 @@ import assert from "assert"; import * as t from "@babel/types"; import template from "@babel/template"; -import chunk from "lodash/chunk"; import { isModule } from "@babel/helper-module-imports"; @@ -419,3 +418,11 @@ function buildInitStatement(metadata: ModuleMetadata, exportNames, initExpr) { }, initExpr), ); } + +function chunk(array, size) { + const chunks = []; + for (let i = 0; i < array.size; i += size) { + chunks.push(array.slice(i, i + size)); + } + return chunks; +} From 05bfbb138de79867cfe63827a0b0a8c10703742c Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 18 Mar 2021 23:17:35 -0400 Subject: [PATCH 2/3] Update lockfile --- yarn.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 3760fee11bb2..32829f8be86f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -673,7 +673,6 @@ __metadata: "@babel/template": "workspace:^7.12.13" "@babel/traverse": "workspace:^7.13.0" "@babel/types": "workspace:^7.13.0" - lodash: ^4.17.19 languageName: unknown linkType: soft From 506ae058bcad0cc2bf033b61ce5b10ce24cb7918 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Thu, 18 Mar 2021 23:39:13 -0400 Subject: [PATCH 3/3] Fix silly prop mistake --- packages/babel-helper-module-transforms/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/babel-helper-module-transforms/src/index.js b/packages/babel-helper-module-transforms/src/index.js index e1fb820106c6..558913a703eb 100644 --- a/packages/babel-helper-module-transforms/src/index.js +++ b/packages/babel-helper-module-transforms/src/index.js @@ -421,7 +421,7 @@ function buildInitStatement(metadata: ModuleMetadata, exportNames, initExpr) { function chunk(array, size) { const chunks = []; - for (let i = 0; i < array.size; i += size) { + for (let i = 0; i < array.length; i += size) { chunks.push(array.slice(i, i + size)); } return chunks;