Skip to content

Reduce build size #32

Closed
Closed
@ankurk91

Description

@ankurk91

Hi,
I was trying to reduce my webpack bundle size.
I found that you are also packing accounting-js in your "dist".
You can exclude this be tweaking your webpack config.

  entry: './src/index.js',
  externals: [
    'vue',
    'accounting-js',
  ],

Don't worry; your dist file will still has a reference to accounting-js and will be included by developer webpack.

Benefits

  • This will reduce this package size to ~ 4kb
  • Better debugging because dist does not include any 3rd party code
  • Take advantage of webpack tree shaking
  • Prevent duplicate bundling when a developer has also installed accounting-js as dependency in his project

Cons

  • When using this package without webpack (directly in browser); end user need to include accounting-js just before this script.

Findings

Thanks.

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