mirror of
https://github.com/grafana/grafana.git
synced 2025-01-18 20:43:26 -06:00
3c6e0e8ef8
* 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
40 lines
1.0 KiB
TypeScript
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' })];
|