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

Commit

Permalink
Add commonjs bundle as main entry point (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound authored and istarkov committed Apr 11, 2017
1 parent cf2910c commit a356356
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,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 @@ -29,15 +29,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

0 comments on commit a356356

Please sign in to comment.