grafana/packages/grafana-e2e/rollup.config.ts
Hugo Häggmark b09b49fb37
e2e: creates a separate package for selectors (#23858)
* Initial commit

* Chore: fixes after merge

* Chore: removes todos

* Chore: uncomment test

* Chore: adds missing externals to rollup config

* Refactor: selectors is master for everything

* Docs: updates Docs

* Chore: adds e2e-selectors to publish
2020-04-27 09:09:05 +02:00

40 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: {},
},
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' })];