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

40 lines
1.0 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';
import copy from 'rollup-plugin-copy';
import sourceMaps from 'rollup-plugin-sourcemaps';
import { terser } from 'rollup-plugin-terser';
const { name } = require('./package.json');
const buildCjsPackage = ({ env }) => ({
input: 'compiled/index.js',
output: {
file: `dist/index.${env}.js`,
name,
format: 'cjs',
sourcemap: true,
exports: 'named',
globals: {},
},
external: ['@grafana/e2e-selectors'],
plugins: [
copy({
flatten: false,
targets: [
{ src: 'bin/**/*.*', dest: 'dist/bin/' },
{ src: 'cli.js', dest: 'dist/' },
{ src: 'cypress.json', dest: 'dist/' },
{ src: 'cypress/**/*.*', dest: 'dist/cypress/' },
],
}),
commonjs({
include: /node_modules/,
}),
resolve(),
sourceMaps(),
env === 'production' && terser(),
],
});
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];