grafana/packages/grafana-e2e/rollup.config.ts
Steven Vachon ee5fcc03df
@grafana/e2e: added support for plugin repositories (#22546)
* Minor changes

* Include Cypress support files in published package

* Added CLI

… with support for custom configurations (which Cypress does not currently support by default):

  * Loads cypress.json from @grafana/e2e as a base config (via a custom Cypress plugin)
  * Sets default values for project-level Cypress files (tests, etc)
  * Optionally loads a cypress.json from the current working directory as overrides

* Updated lockfile
2020-03-03 18:12:52 -05:00

39 lines
1.0 KiB
TypeScript

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: {},
},
plugins: [
copy({
flatten: false,
targets: [
{ src: 'compiled/bin/**/*.*', dest: 'dist/' },
{ src: 'compiled/cli/**/*.*', dest: 'dist/' },
{ src: 'cypress.json', dest: 'dist/' },
{ src: 'cypress/**/*.+(js|ts)', dest: 'dist/cypress/' },
],
}),
commonjs({
include: /node_modules/,
}),
resolve(),
sourceMaps(),
env === 'production' && terser(),
],
});
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];