Skip to content

Commit

Permalink
Extend existing externals
Browse files Browse the repository at this point in the history
  • Loading branch information
timmartin19 committed Jun 19, 2020
1 parent e34e4fa commit 03d96d1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 20 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
25 changes: 8 additions & 17 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 [
Expand All @@ -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',
Expand All @@ -84,12 +80,7 @@ export default [
{
dir: 'dist/bundle-es',
format: 'esm',
globals: {
react: 'React',
'react-dom': 'ReactDOM',
},
},
],
plugins: [...defaultConfig.plugins, peerDepsExternal()],
},
];

0 comments on commit 03d96d1

Please sign in to comment.