grafana/packages/grafana-e2e/rollup.config.ts
Josh Hunt 3c6e0e8ef8
Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00

40 lines
1.0 KiB
TypeScript

import commonjs from '@rollup/plugin-commonjs';
import resolve from '@rollup/plugin-node-resolve';
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' })];