-
Notifications
You must be signed in to change notification settings - Fork 247
fix(module): Add export for commonjs #88
fix(module): Add export for commonjs #88
Conversation
Add commonjs export, so it is possible to require crossEnv using `require('cross-env')` (needed to use in js script without babel) 84
There was a problem hiding this 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!
src/index.test.js
Outdated
@@ -1,10 +1,17 @@ | |||
import crossSpawnMock from 'cross-spawn' | |||
import crossEnv from '.' | |||
|
|||
const commonJSCrossEnv = require('.') |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
There was a problem hiding this 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!
Thanks! |
* 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
Add commonjs export, so it is possible to require crossEnv using
require('cross-env')
(needed touse in js script without babel)
#84