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

Don't transform modules with import/export #96

Merged
merged 2 commits into from
Sep 16, 2016
Merged

Conversation

Rich-Harris
Copy link
Contributor

Even if they contain CJS features like require, global etc. Ref #88 (comment)

@talmobi
Copy link

talmobi commented Sep 8, 2016

Had this issue with the recently released newest version of redux@3.6.0 (https://github.com/reactjs/redux/releases) which updated its symbol-observable dependency to version 1.0.2 (https://github.com/blesh/symbol-observable/blob/master/CHANGELOG.md) with es6 support.

A temporary fix is to simply ignore symbol-observable specifically as an exclude field in the commonjs plugin.

I just want to say that I tested this PR and it worked out of the box with the newest version of redux@3.6.0 and its updated symbol-observable dependency (and as a result fixed my build and dev npm scripts)

People using redux with the hat character ^ in their dependencies (like I did) will at some points auto update to 3.6.0 and come across this issue that this PR seems to fix.

The only there difference is that using this PR rollup-plugin-version logs out a message when running rollup/build script (not an error)

The `this` keyword is equivalent to `undefined` at the top level of an ES module, and has been rewritten

Other than that everything seems to be working the same.

references: benlesh/symbol-observable#21

@TrySound
Copy link
Member

TrySound commented Sep 8, 2016

@talmobi You don't need this plugin anymore to build redux. Just set rollup option context: 'window'.

@talmobi
Copy link

talmobi commented Sep 8, 2016

Ahh, very good, thanks -- still need the plugin for other libraries though, and unless you exclude symbol-obvservable you get the build error without this PR.

@danbucholtz
Copy link

I have verified that this fixes #100

@benlesh
Copy link

benlesh commented Sep 16, 2016

Thanks for your work on this @Rich-Harris

@Rich-Harris Rich-Harris merged commit 4fee437 into master Sep 16, 2016
@Rich-Harris Rich-Harris deleted the unambiguous branch September 17, 2016 00:16
@Rich-Harris
Copy link
Contributor Author

Sorry for the delay everyone! Just released this as 5.0.0 since it's potentially a breaking change, along with another PR (#106) which should bring bundle sizes down a bit.

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.

5 participants