mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40: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
34 lines
814 B
TypeScript
34 lines
814 B
TypeScript
import commonjs from '@rollup/plugin-commonjs';
|
|
import resolve from '@rollup/plugin-node-resolve';
|
|
import sourceMaps from 'rollup-plugin-sourcemaps';
|
|
import { terser } from 'rollup-plugin-terser';
|
|
|
|
const pkg = require('./package.json');
|
|
|
|
const libraryName = pkg.name;
|
|
|
|
const buildCjsPackage = ({ env }) => {
|
|
return {
|
|
input: `compiled/index.js`,
|
|
output: [
|
|
{
|
|
file: `dist/index.${env}.js`,
|
|
name: libraryName,
|
|
format: 'cjs',
|
|
sourcemap: true,
|
|
exports: 'named',
|
|
globals: {},
|
|
},
|
|
],
|
|
plugins: [
|
|
commonjs({
|
|
include: /node_modules/,
|
|
}),
|
|
resolve(),
|
|
sourceMaps(),
|
|
env === 'production' && terser(),
|
|
],
|
|
};
|
|
};
|
|
export default [buildCjsPackage({ env: 'development' }), buildCjsPackage({ env: 'production' })];
|