You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner. It is now read-only.
If you don't know about rollup, I highly recommend having a look into it.
It can output a much smaller distribution file than using babel directly.
I've released a simple react library and I did a lot of tests before deciding to stick with Rollup - it's a big difference, you should give it a try too. The config would be something like this:
importbabelfrom'rollup-plugin-babel';importreplacefrom'rollup-plugin-replace';importcommonjsfrom'rollup-plugin-commonjs';importnodeResolvefrom'rollup-plugin-node-resolve';exportdefault{moduleName: 'NameOfYourModuleForAMD',entry: './src/index.js',dest: './dist/index.js',format: 'umd',plugins: [babel(),commonjs()],globals: {react: 'React'// because you don't want to include React on the bundled js}};
Plus you have the benefit of having a UMD package.
And just one smaller thing, I would add "react" as a peerDependency so people can choose the React version they want to use.
The text was updated successfully, but these errors were encountered:
If you don't know about rollup, I highly recommend having a look into it.
It can output a much smaller distribution file than using babel directly.
I've released a simple react library and I did a lot of tests before deciding to stick with Rollup - it's a big difference, you should give it a try too. The config would be something like this:
Plus you have the benefit of having a UMD package.
And just one smaller thing, I would add "react" as a
peerDependency
so people can choose the React version they want to use.The text was updated successfully, but these errors were encountered: