8000 geopattern adds a large chunk after webpack build · Issue #32 · btmills/geopattern · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
geopattern adds a large chunk after webpack build #32
Closed
@aviaryan

Description

@aviaryan

I see that the minified version of geopattern in this repository is <20kb.
But when I bundle geopattern using webpack, it increases the size of the bundle by around 36kb.
What could be going wrong here?
I am importing geopattern as import GeoPattern from 'geopattern'.
My package.json has only the vendor packages as dependencies.

PS - Sorry, I know this is not the best place to ask this question but I couldn't find anything else.

const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
	entry: {
		app: './src/index.jsx',
		vendor: ['react', 'react-dom', 'geopattern', 'react-router-dom', 'redux']
	},
	module: {
		loaders: [{
			test: /\.jsx?$/,
			exclude: /node_modules/,
			loader: 'babel-loader',
			query: {
				presets: ['es2015', 'react']
			}
		}, {
			test: /\.css$/,
			use:  ExtractTextPlugin.extract({
				use: [{
					loader: 'css-loader',
					options: { importLoaders: 1, modules: true, localIdentName: '[local]-[hash:base64:5]' },
				}],
			}),
		}]
	},
	resolve: {
		extensions: ['.js', '.jsx']
	},
	output: {
		path: __dirname + '/dist',
		publicPath: '/dist/',
		filename: 'bundle.js'
	},
	plugins: [
		// extract text
		new ExtractTextPlugin("styles.css"),
		// minify
		new webpack.optimize.UglifyJsPlugin({
			mangle: true,
			compress: {
				warnings: false, // Suppress uglification warnings
				pure_getters: true,
				unsafe: true,
				unsafe_comps: true,
				screw_ie8: true,
				conditionals: true,
				unused: true,
				comparisons: true,
				sequences: true,
				dead_code: true,
				evaluate: true,
				if_return: true,
				join_vars: true
			},
			comments: false
		}),
		// vendor: https://webpack.github.io/docs/code-splitting.html#split-app-and-vendor-code
		new webpack.optimize.CommonsChunkPlugin({name: 'vendor', filename: 'vendor.bundle.js'})
	]
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0