mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
69201bbf8c
* moved the datasource picker to grafana-runtime. * fixed imports. * added e2e selectors as an external package. * adding react as external package. * exposing dependent types for DataSourcePicker. * added docs for ui components. * moving component to components.
35 lines
934 B
TypeScript
35 lines
934 B
TypeScript
import resolve from '@rollup/plugin-node-resolve';
|
|
import commonjs from '@rollup/plugin-commonjs';
|
|
import sourceMaps from 'rollup-plugin-sourcemaps';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
const pkg = require('./package.json');
|
|
|
|
const libraryName = pkg.name;
|
|
|
|
const buildCjsPackage = ({ env }) => {
|
|
return {
|
|
input: `compiled/index.js`,
|
|
output: [
|
|
{
|
|
file: `dist/index.${env}.js`,
|
|
name: libraryName,
|
|
format: 'cjs',
|
|
sourcemap: true,
|
|
exports: 'named',
|
|
globals: {},
|
|
},
|
|
],
|
|
external: ['lodash', 'react', '@grafana/ui', '@grafana/data', '@grafana/e2e-selectors'], // Use Lodash from grafana
|
|
plugins: [
|
|
commonjs({
|
|
include: /node_modules/,
|
|
}),
|
|
resolve(),
|
|
sourceMaps(),
|
|
env === 'production' && terser(),
|
|
],
|
|
};
|
|
};
|
|
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|