Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

fix(module): Add export for commonjs #88

Merged
merged 2 commits into from
Mar 14, 2017
Merged

fix(module): Add export for commonjs #88

merged 2 commits into from
Mar 14, 2017

Conversation

thomasthiebaud
Copy link
Contributor

@thomasthiebaud thomasthiebaud commented Mar 14, 2017

Add commonjs export, so it is possible to require crossEnv using require('cross-env') (needed to
use in js script without babel)

#84

Add commonjs export, so it is possible to require crossEnv using `require('cross-env')` (needed to
use in js script without babel)

84
Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! Thanks!

@@ -1,10 +1,17 @@
import crossSpawnMock from 'cross-spawn'
import crossEnv from '.'

const commonJSCrossEnv = require('.')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

src/index.js Outdated
@@ -1,6 +1,7 @@
import {spawn} from 'cross-spawn'
import commandConvert from './command'

module.exports = crossEnv
export default crossEnv
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and remove this and just disable the rule for the offending line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sure, I do it now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you prefer a new commit or a push -f ?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way is fine, I'll do a squash and merge when I merge your pull request anyway

Copy link
Owner

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is very. Great!

@kentcdodds kentcdodds merged commit 5a6e3b8 into kentcdodds:next Mar 14, 2017
@kentcdodds
Copy link
Owner

Thanks!

@thomasthiebaud thomasthiebaud deleted the pr/commonjs-export branch March 14, 2017 19:59
kentcdodds pushed a commit that referenced this pull request Mar 31, 2017
* fix(module): Add export for commonjs

Add commonjs export, so it is possible to require crossEnv using `require('cross-env')` (needed to
use in js script without babel)

84

* fix(module): Only export crossEnv using commonjs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants