grafana/packages/grafana-ui/rollup.config.ts
Erik Sundell f0d6f132ae
SigV4: Add support EC2 IAM role auth and possibility to toggle auth providers (#32444)
* wip: consume aws-sdk config in auth http settings

* fix typings

* use sdk regions

* use latest version of grafana/aws-sdk

* use newest sdk

* add comment

* bump sdk

* fix yarn lock file

* fix storybook issue

* upgrade aws-sdk. also use it in grafana ui

* remove not used config

* add aws-sdk as an external dep for grafana in the grafana ui rollup

Co-authored-by: Will Browne <will.browne@grafana.com>
2021-03-30 12:30:34 +02:00

51 lines
1.3 KiB
TypeScript

import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import image from '@rollup/plugin-image';
import { terser } from 'rollup-plugin-terser';
const pkg = require('./package.json');
const libraryName = pkg.name;
const buildCjsPackage = ({ env }) => {
return {
input: `compiled/index.js`,
output: [
{
dir: 'dist',
name: libraryName,
format: 'cjs',
sourcemap: true,
strict: false,
exports: 'named',
chunkFileNames: `[name].${env}.js`,
globals: {
react: 'React',
'prop-types': 'PropTypes',
},
},
],
external: [
'react',
'react-dom',
'@grafana/aws-sdk',
'@grafana/data',
'@grafana/e2e-selectors',
'moment',
'monaco-editor', // Monaco should not be used directly
'monaco-editor/esm/vs/editor/editor.api', // Monaco should not be used directly
'react-monaco-editor',
'jquery', // required to use jquery.plot, which is assigned externally
],
plugins: [
commonjs({
include: /node_modules/,
}),
resolve(),
image(),
env === 'production' && terser(),
],
};
};
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];