grafana/packages/grafana-ui/rollup.config.ts

51 lines
1.3 KiB
TypeScript
Raw Normal View History

DevEnv: update frontend dependencies - rollup (#22794) * DevEnv: updates rollup 1.6.0 -> 2.0.6 in grafana-data package * DevEnv: updates rollup 1.6.0 -> 2.0.6 in grafana-e2e package * DevEnv: updates rollup 1.6.0 -> 2.0.6 in grafana-runtime package * DevEnv: updates rollup 1.6.0 -> 2.0.6 in grafana-ui package * DevEnv: updates rollup-plugin-sourcemaps 0.4.2 -> 0.5.0 in grafana-data package * DevEnv: updates rollup-plugin-sourcemaps 0.4.2 -> 0.5.0 in grafana-e2e package * DevEnv: updates rollup-plugin-sourcemaps 0.4.2 -> 0.5.0 in grafana-runtime package * DevEnv: updates rollup-plugin-sourcemaps 0.4.2 -> 0.5.0 in grafana-ui package * DevEnv: updates rollup-plugin-terser 4.0.4 -> 5.3.0 in grafana-data package * DevEnv: updates rollup-plugin-terser 4.0.4 -> 5.3.0 in grafana-e2e package * DevEnv: updates rollup-plugin-terser 4.0.4 -> 5.3.0 in grafana-runtime package * DevEnv: updates rollup-plugin-terser 4.0.4 -> 5.3.0 in grafana-ui package * DevEnv: updates rollup-plugin-typescript2 0.19.3 -> 0.26.0 in grafana-data package * DevEnv: updates rollup-plugin-typescript2 0.19.3 -> 0.26.0 in grafana-e2e package * DevEnv: updates rollup-plugin-typescript2 0.19.3 -> 0.26.0 in grafana-runtime package * DevEnv: updates rollup-plugin-typescript2 0.19.3 -> 0.26.0 in grafana-ui package * DevEnv: updates @rollup/plugin-commonjs 9.2.1 -> 11.0.2 in grafana-data package * DevEnv: updates @rollup/plugin-commonjs 9.2.1 -> 11.0.2 in grafana-e2e package * DevEnv: updates @rollup/plugin-commonjs 9.2.1 -> 11.0.2 in grafana-runtime package * DevEnv: updates @rollup/plugin-commonjs 9.2.1 -> 11.0.2 in grafana-ui package * DevEnv: updates rollup config import in grafana-data package * DevEnv: updates rollup config import in grafana-e2e package * DevEnv: updates rollup config import in grafana-ui package * DevEnv: updates rollup config import in grafana-runtime package * DevEnv: updates @rollup/plugin-node-resolve 4.0.1 -> 7.1.1 in grafana-data package * DevEnv: updates @rollup/plugin-node-resolve 4.0.1 -> 7.1.1 in grafana-e2e package * DevEnv: updates @rollup/plugin-node-resolve 4.0.1 -> 7.1.1 in grafana-runtime package * DevEnv: updates @rollup/plugin-node-resolve 4.0.1 -> 7.1.1 in grafana-ui package * DevEnv: updates lockfile * DevEnv: updates rollup config plugin-node-resolve import in grafana-data package * DevEnv: updates rollup config plugin-node-resolve import in grafana-ui package * DevEnv: updates rollup config plugin-node-resolve import in grafana-e2e package * DevEnv: updates rollup config plugin-node-resolve import in grafana-runtime package * DevEnv: updates rollup-plugin-visualizer 0.9.2 -> 3.3.1 in grafana-data package * DevEnv: updates rollup-plugin-visualizer 0.9.2 -> 3.3.1 in grafana-e2e package * DevEnv: updates rollup-plugin-visualizer 0.9.2 -> 3.3.1 in grafana-runtime package * DevEnv: updates rollup-plugin-visualizer 0.9.2 -> 3.3.1 in grafana-ui package
2020-03-15 10:39:40 -05:00
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
2020-05-05 03:39:49 -05:00
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(),
2020-05-05 03:39:49 -05:00
image(),
env === 'production' && terser(),
],
};
};
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];