From 03d96d152152a78a6bbe4767eed5007729d304e7 Mon Sep 17 00:00:00 2001 From: Tim Martin Date: Fri, 19 Jun 2020 18:59:23 -0400 Subject: [PATCH] Extend existing externals --- package.json | 6 +++--- rollup.config.js | 25 ++++++++----------------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index dba382f2c..49562b6be 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "9.0.0-alpha.0", "description": "Curology's React based component library", "main": "dist/bundle.js", - "module": "dist/bundle-es/src/index.js", + "module": "dist/bundle-es/index.js", "files": [ "dist", "lib", @@ -117,9 +117,7 @@ "jest-emotion": "10.0.27", "jest-junit": "^10.0.0", "lint-staged": "^10.1.3", - "lodash.round": "^4.0.4", "prettier": "1.14.3", - "react-dom": "^16.8.6", "react-test-renderer": "^16.8.6", "regenerator-runtime": "^0.12.1", "rimraf": "^2.6.2", @@ -135,10 +133,12 @@ "dependencies": { "@emotion/core": "10.0.10", "@emotion/styled": "10.0.10", + "lodash.round": "^4.0.4", "lodash.throttle": "^4.1.1", "lodash.uniqueid": "^4.0.1", "prop-types": "^15.7.2", "react": "^16.8.6", + "react-dom": "^16.8.6", "react-modal": "^3.8.1", "react-slick": "^0.23.2", "react-toggle-button": "^2.2.0", diff --git a/rollup.config.js b/rollup.config.js index 070a27216..53381fe2e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,7 +3,8 @@ import resolve from '@rollup/plugin-node-resolve'; import babel from '@rollup/plugin-babel'; import { sizeSnapshot } from 'rollup-plugin-size-snapshot'; import svgr from '@svgr/rollup'; -import peerDepsExternal from 'rollup-plugin-peer-deps-external'; + +import pkg from './package'; // eslint-disable-next-line import/no-extraneous-dependencies const path = require('path'); @@ -37,17 +38,7 @@ const defaultConfig = { }), sizeSnapshot(), ], - external: [ - '@emotion/core', - '@emotion/styled', - 'prop-types', - 'react', - 'react-modal', - 'react-slick', - 'react-toggle-button', - 'react-transition-group', - 'tinycolor2', - ], + external: [...Object.keys(pkg.dependencies), '@emotion/styled-base'], }; export default [ @@ -66,8 +57,13 @@ export default [ globals: { '@emotion/core': '@emotion/core', '@emotion/styled': 'styled', + '@emotion/styled-base': '_styled', + 'lodash.round': 'round', + 'lodash.throttle': 'throttle', + 'lodash.uniqueid': 'uniqueid', 'prop-types': 'PropTypes', react: 'React', + 'react-dom': 'ReactDOM', 'react-modal': 'react-modal', 'react-slick': 'react-slick', 'react-toggle-button': 'react-toggle-button', @@ -84,12 +80,7 @@ export default [ { dir: 'dist/bundle-es', format: 'esm', - globals: { - react: 'React', - 'react-dom': 'ReactDOM', - }, }, ], - plugins: [...defaultConfig.plugins, peerDepsExternal()], }, ];