mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
b09b49fb37
* 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
40 lines
1.0 KiB
TypeScript
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' })];
|