Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Add commonjs bundle as main entry point #351

Merged
merged 1 commit into from
Apr 11, 2017
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
1 change: 1 addition & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const run = async () => {
`--environment BUILD:${build},PACKAGE_NAME:${packageName}`
if (exec([
runRollup('es'),
runRollup('cjs'),
runRollup('umd'),
runRollup('min')
].join(' && ')).code !== 0) {
Expand Down
10 changes: 6 additions & 4 deletions scripts/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ const config = {
]
}

if (build === 'es') {
if (build === 'es' || build === 'cjs') {
config.external.push(
'fbjs/lib/shallowEqual',
'hoist-non-react-statics',
'change-emitter',
'symbol-observable'
'symbol-observable',
'react-relay',
'recompose'
)
config.dest = `${outDir}/es/${libraryName}.js`
config.format = 'es'
config.dest = `${outDir}/${build}/${libraryName}.js`
config.format = build
}

if (build === 'umd') {
Expand Down
1 change: 0 additions & 1 deletion src/basePackage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "git",
"url": "https://github.com/acdlite/recompose.git"
},
"main": "index.js",
"license": "MIT",
"bugs": {
"url": "https://github.com/acdlite/recompose/issues"
Expand Down
3 changes: 1 addition & 2 deletions src/packages/recompose-relay/createContainer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import Relay from 'react-relay'
import toClass from 'recompose/toClass'
import createHelper from 'recompose/createHelper'
import { toClass, createHelper } from 'recompose'

const createContainer = options => BaseComponent =>
Relay.createContainer(toClass(BaseComponent), options)
Expand Down
1 change: 1 addition & 0 deletions src/packages/recompose-relay/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"utilities",
"composition"
],
"main": "cjs/RecomposeRelay.js",
"module": "es/RecomposeRelay.js",
"dependencies": {
"lodash": "^4.0.0"
Expand Down
1 change: 1 addition & 0 deletions src/packages/recompose/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"utilities",
"composition"
],
"main": "cjs/Recompose.js",
"module": "es/Recompose.js",
"dependencies": {
"change-emitter": "^0.1.2",
Expand Down