grafana / grafana-aws-sdk-react

Apache License 2.0
3 stars 1 forks source link

Update rollup bundling config #33

Closed kevinwcyu closed 1 year ago

kevinwcyu commented 1 year ago

Fixes: #30

Update rollup config to take advantage of treeshaking and esm builds.

As an example, see the config for @grafana/ui which is supposed to be an up-to-date config for bundling libraries.

Quick manual tests with Cloudwatch, Athena, Redshift, Timestream, and X-Ray by checking the config editor and the query editor and everything still works.

kevinwcyu commented 1 year ago

How come we don't generate one index file for development and one for production anymore?

@sunker I was following the reasoning from the @grafana/ui config

We currently bundle index.development.js and index.production.js files for all packages. This PR removes them in favour of a single build (packaged as CJS and ESM) without minification and includes sourcemaps. Reasoning for this change is that if a consumer wants to use this package their app build tooling can minify the package. Likewise for plugin developers these packages are only used in test environments making a minified production build a bit redundant IMHO.

https://github.com/grafana/grafana/pull/51517#issue-1287604005