I'm trying to bundle a simple reactjs app using JSPM's built-in bundling API but it results to a very large file.
Here's my sample code:
import React from 'react';
class Main extends React.Component {
render() {
return <div>Hello World</div>;
}
}
React.render(<Main />, document.getElementById('main'));
I perform the bundling with this command:
jspm bundle-sfx app/main build/main.js
The resulting file is 888kb unminified, and 461kb minified. How do you go about properly bundling a React app with JSPM so it won't result in such an unnecessarily large file.
EDIT:
I've considered excluding reactjs from bundling which works fine, but when I start using reactjs-dependent libraries like react-router, it's back to including reactjs to the bundle.