Fix: Prevent Rollup from treeshaking NPM packages (#108567)

fix(packages): prevent rollup from treeshaking libraries
This commit is contained in:
Jack Westbrook
2025-07-24 10:54:02 +02:00
committed by GitHub
parent b1de534092
commit 15d9df93f9
9 changed files with 14 additions and 0 deletions
@@ -10,10 +10,12 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
treeshake: false,
},
{
input: 'src/unstable.ts',
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
treeshake: false,
},
];
+2
View File
@@ -10,10 +10,12 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
treeshake: false,
},
{
input: 'src/unstable.ts',
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
treeshake: false,
},
];
@@ -10,5 +10,6 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-e2e-selectors')],
treeshake: false,
},
];
@@ -10,5 +10,6 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-flamegraph')],
treeshake: false,
},
];
+1
View File
@@ -16,5 +16,6 @@ export default [
}),
],
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-i18n')],
treeshake: false,
},
];
@@ -13,5 +13,6 @@ export default [
input: entryPoint,
plugins: [...plugins, image(), json(), dynamicImportVars()],
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-prometheus')],
treeshake: false,
},
];
@@ -10,10 +10,12 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
treeshake: false,
},
{
input: 'src/unstable.ts',
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
treeshake: false,
},
];
+2
View File
@@ -16,6 +16,7 @@ export default [
input: entryPoint,
plugins,
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-schema')],
treeshake: false,
},
{
input: Object.fromEntries(
@@ -45,5 +46,6 @@ export default [
format: 'esm',
dir: path.dirname(pkg.publishConfig.module),
},
treeshake: false,
},
];
+2
View File
@@ -25,6 +25,7 @@ export default [
}),
],
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
treeshake: false,
},
{
input: 'src/unstable.ts',
@@ -37,5 +38,6 @@ export default [
}),
],
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
treeshake: false,
},
];