mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 17:02:19 +08:00

* chore(packages): remove rollup dts plugin * build(packages): add rollup copy plugin settings to copy ts declarations to esm and cjs builds * build(packages): remove copy settings as result doesnt pass attw cli checks * build(packages): use single types output in dist/types directory * ci(packages): update prepare and validate scripts for single type builds * fix(grafana-schema): copy raw types to dist/esm directory for grafana/scenes support
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { createRequire } from 'node:module';
|
|
import copy from 'rollup-plugin-copy';
|
|
import svg from 'rollup-plugin-svg-import';
|
|
|
|
import { cjsOutput, entryPoint, esmOutput, plugins } from '../rollup.config.parts';
|
|
|
|
const rq = createRequire(import.meta.url);
|
|
const icons = rq('../../public/app/core/icons/cached.json');
|
|
const pkg = rq('./package.json');
|
|
|
|
const iconSrcPaths = icons.map((iconSubPath) => {
|
|
// eslint-disable-next-line @grafana/no-restricted-img-srcs
|
|
return `../../public/img/icons/${iconSubPath}.svg`;
|
|
});
|
|
|
|
export default [
|
|
{
|
|
input: entryPoint,
|
|
plugins: [
|
|
...plugins,
|
|
svg({ stringify: true }),
|
|
copy({
|
|
targets: [{ src: iconSrcPaths, dest: './dist/public/' }],
|
|
flatten: false,
|
|
}),
|
|
],
|
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
|
},
|
|
{
|
|
input: 'src/unstable.ts',
|
|
plugins: [
|
|
...plugins,
|
|
svg({ stringify: true }),
|
|
copy({
|
|
targets: [{ src: iconSrcPaths, dest: './dist/public/' }],
|
|
flatten: false,
|
|
}),
|
|
],
|
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
|
},
|
|
];
|