mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
ee5fcc03df
* 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
39 lines
1.0 KiB
TypeScript
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' })];
|