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

Moving module.exports to the top level #14

Merged
merged 2 commits into from
Apr 18, 2017
Merged

Conversation

Pauan
Copy link
Contributor

@Pauan Pauan commented Jan 14, 2017

I am using a Rollup plugin which converts CommonJS to ES6 modules.

It does this by converting module.exports = foo; into export default foo;

However, this only works if the module.exports is at the top level, because ES6 requires all exports to be at the top level.

This pull request moves the module.exports to the top level, so that it will work with my plugin.

document.js Outdated
@@ -3,13 +3,13 @@ var topLevel = typeof global !== 'undefined' ? global :
var minDoc = require('min-document');

if (typeof document !== 'undefined') {
module.exports = document;
var doccy = document;
Copy link
Owner

Choose a reason for hiding this comment

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

nit: please declare var doccy outside the if statement

window.js Outdated
@@ -1,9 +1,11 @@
if (typeof window !== "undefined") {
module.exports = window;
var win = window;
Copy link
Owner

Choose a reason for hiding this comment

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

nit: please declare var win outside the if statement.

@Pauan
Copy link
Contributor Author

Pauan commented Apr 18, 2017

@Raynos I fixed the nits.

@Raynos Raynos merged commit f187874 into Raynos:master Apr 18, 2017
@Raynos
Copy link
Owner

Raynos commented Apr 18, 2017

Merged, will publish new version.

If I forget ping me :) (on phone)

@Pauan
Copy link
Contributor Author

Pauan commented Apr 19, 2017

@Raynos Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants