Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eds-core-react bundle improvements #855

Merged
merged 1 commit into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions libraries/core-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"publishConfig": {
"main": "dist/core-react.cjs.js",
"module": "dist/core-react.es.js",
"browser": "dist/core-react.umd.js",
"types": "dist/types/index.d.ts"
"browser": "dist/core-react.umd.js"
},
"types": "dist/types/index.d.ts",
"license": "AGPL-3.0-or-later",
"author": {
"name": "EDS Core Team",
Expand All @@ -29,8 +29,7 @@
"scripts": {
"prepare": "npm run build",
"build": "rollup -c",
"build:for-storybook": "rollup -c",
"dev": "rollup -c -w",
"dev": "rollup -c -w NODE_ENV=development",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down
8 changes: 5 additions & 3 deletions libraries/core-react/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import typescript from 'rollup-plugin-typescript2'
import pkg from './package.json'

const peerDeps = Object.keys(pkg.peerDependencies || {})
const environment = process.env.NODE_ENV

const isDevelopment = environment === 'development'

const globals = {
react: 'React',
Expand All @@ -21,7 +24,6 @@ export default [
{
input: './src/index.ts',
external: peerDeps,
// : [...peerDeps, 'focus-visible'],
watch: {
clearScreen: true,
include: ['./src/**', './../tokens/**'],
Expand All @@ -48,8 +50,8 @@ export default [
{
file: pkg.publishConfig.module,
name: pkg.name,
format: 'esm',
sourcemap: true,
format: 'es',
sourcemap: isDevelopment,
globals,
},
{ file: pkg.publishConfig.main, format: 'cjs' },
Expand Down