From 3e72510d76a5f013884d632ba75b6e41ed99437a Mon Sep 17 00:00:00 2001 From: Bogdan Chadkin Date: Sun, 9 Jun 2019 18:01:18 +0300 Subject: [PATCH] Use lodash-es for esm bundle Similar way is used by formik. https://unpkg.com/formik@1.5.7/dist/formik.esm.js https://unpkg.com/formik@1.5.7/dist/formik.cjs.development.js --- .babelrc | 5 +++++ .size-snapshot.json | 24 ++++++++++++------------ package.json | 2 ++ yarn.lock | 5 +++++ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.babelrc b/.babelrc index fdc848e31..65aade2a5 100644 --- a/.babelrc +++ b/.babelrc @@ -7,6 +7,11 @@ "esm": { "presets": [ ["jason", { "modules": false }] + ], + "plugins": [ + ["babel-plugin-transform-rename-import", { + replacements: [{ original: "lodash", replacement: "lodash-es" }] + }] ] } } diff --git a/.size-snapshot.json b/.size-snapshot.json index 84da473f6..0a543a552 100644 --- a/.size-snapshot.json +++ b/.size-snapshot.json @@ -1,25 +1,25 @@ { "./dist/react-big-calendar.js": { - "bundled": 560715, - "minified": 171082, - "gzipped": 50325 + "bundled": 554005, + "minified": 170219, + "gzipped": 50027 }, "./dist/react-big-calendar.min.js": { - "bundled": 496938, - "minified": 151688, - "gzipped": 45761 + "bundled": 490228, + "minified": 150810, + "gzipped": 45487 }, "dist/react-big-calendar.esm.js": { - "bundled": 169709, - "minified": 81558, - "gzipped": 20076, + "bundled": 169733, + "minified": 81582, + "gzipped": 20080, "treeshaked": { "rollup": { - "code": 62946, - "import_statements": 1378 + "code": 62970, + "import_statements": 1402 }, "webpack": { - "code": 66385 + "code": 66409 } } } diff --git a/package.json b/package.json index 9e590ebdc..2fb291c80 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "babel-eslint": "^10.0.1", "babel-jest": "^23.6.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.22", + "babel-plugin-transform-rename-import": "^2.3.0", "babel-preset-jason": "^6.0.1", "bootstrap": "^3.3.5", "component-metadata-loader": "^4.0.0", @@ -126,6 +127,7 @@ "dom-helpers": "^3.4.0", "invariant": "^2.2.4", "lodash": "^4.17.11", + "lodash-es": "^4.17.11", "memoize-one": "^4.0.3", "prop-types": "^15.6.2", "react-overlays": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index 399a53f5e..3630dc80c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2634,6 +2634,11 @@ babel-plugin-transform-remove-undefined@^0.5.0: dependencies: babel-helper-evaluate-path "^0.5.0" +babel-plugin-transform-rename-import@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-rename-import/-/babel-plugin-transform-rename-import-2.3.0.tgz#5d9d645f937b0ca5c26a24b2510a06277b6ffd9b" + integrity sha512-dPgJoT57XC0PqSnLgl2FwNvxFrWlspatX2dkk7yjKQj5HHGw071vAcOf+hqW8ClqcBDMvEbm6mevn5yHAD8mlQ== + babel-plugin-transform-simplify-comparison-operators@^6.9.4: version "6.9.4" resolved "https://registry.yarnpkg.com/babel-plugin-transform-simplify-comparison-operators/-/babel-plugin-transform-simplify-comparison-operators-6.9.4.tgz#f62afe096cab0e1f68a2d753fdf283888471ceb9"