[release-12.1.2] Fix: Prevent Rollup from treeshaking NPM packages (#108570)
Fix: Prevent Rollup from treeshaking NPM packages (#108567)
fix(packages): prevent rollup from treeshaking libraries
(cherry picked from commit 15d9df93f9)
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
This commit is contained in:
co-authored by
Jack Westbrook
parent
fb80e2d4bf
commit
52ecba092c
@@ -10,10 +10,12 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/unstable.ts',
|
input: 'src/unstable.ts',
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-alerting')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/unstable.ts',
|
input: 'src/unstable.ts',
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-data')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-e2e-selectors')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-e2e-selectors')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-flamegraph')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-flamegraph')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -16,5 +16,6 @@ export default [
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-i18n')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-i18n')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins: [...plugins, image(), json(), dynamicImportVars()],
|
plugins: [...plugins, image(), json(), dynamicImportVars()],
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-prometheus')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-prometheus')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -10,10 +10,12 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/unstable.ts',
|
input: 'src/unstable.ts',
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-runtime')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default [
|
|||||||
input: entryPoint,
|
input: entryPoint,
|
||||||
plugins,
|
plugins,
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-schema')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-schema')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: Object.fromEntries(
|
input: Object.fromEntries(
|
||||||
@@ -45,5 +46,6 @@ export default [
|
|||||||
format: 'esm',
|
format: 'esm',
|
||||||
dir: path.dirname(pkg.publishConfig.module),
|
dir: path.dirname(pkg.publishConfig.module),
|
||||||
},
|
},
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ export default [
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: 'src/unstable.ts',
|
input: 'src/unstable.ts',
|
||||||
@@ -37,5 +38,6 @@ export default [
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')],
|
||||||
|
treeshake: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user