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

Bundling for production #90

Closed
dagumak opened this issue Aug 7, 2016 · 2 comments
Closed

Bundling for production #90

dagumak opened this issue Aug 7, 2016 · 2 comments

Comments

@dagumak
Copy link

dagumak commented Aug 7, 2016

How can I make the bundles smaller? Between react, jQuery, and bootstrap, my builds are already huge! I tried the following configurations, but it still seems to be very big (1.2MB). Is there a recommended configuration? It might be even better to avoid bundling jQuery, bootstrap, and react together. Having the separate will let the browser download these in parallel. Thoughts?

    plugins: [
        new webpack.DefinePlugin({
            'process.env': {
                'NODE_ENV': JSON.stringify('production')
            }
        }),
        new webpack.ProvidePlugin({
            $:      "jquery",
            jQuery: "jquery"
        }),
        new webpack.optimize.DedupePlugin(),
        new webpack.optimize.UglifyJsPlugin({
            compress: { warnings: false },
            comments: false,
            sourceMap: false,
            mangle: {
                toplevel: true
            }
        })
    ]
@dagumak
Copy link
Author

dagumak commented Aug 7, 2016

I found your other post, and it said to use devtool: 'source-map' and that made a huge difference! That dropped it from 1.2M to 405kb. Still kind of big, but a lot better now. I would be open to decreasing this further if possible.

@calesce
Copy link
Collaborator

calesce commented Nov 1, 2016

We're tracking this in #63, will update soon!

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

No branches or pull requests

2 participants