React-native-web: Export ES6 modules to npm

Created on 17 Mar 2016  路  6Comments  路  Source: necolas/react-native-web

This will be valuable for people using bundlers like webpack@2 and rollup, as the bundles will omit any modules that aren't used by the app.

Probably means ES6-ifying a bunch of RN imports/exports. But I'm not sure how to ensure that the ES5 pattern used through RN apps and components is preserved (e.g., var Animated = React.Animated)

Most helpful comment

All 6 comments

See if react-native is open to adding options to their preset to allow disabling transform of modules to commonjs: https://github.com/facebook/react-native/commit/98dd91825f65e115cdf13c464689ee6c2bb8e27f

Ref: https://github.com/babel/babel/blob/master/packages/babel-preset-es2015/src/index.js

Unnecessary at the moment

hi @necolas, are there any way to reduce bundle size now. in my project, it bundle the whole react-native-web lib now. Are there any thing I can help to reduce bundle size?

screen shot 2018-02-02 at 5 42 15 pm

nice. Thanks a lot

Was this page helpful?
0 / 5 - 0 ratings