зеркало из https://github.com/microsoft/griffel.git
21 строка
600 B
JavaScript
21 строка
600 B
JavaScript
function getRollupOptions(/** @type {import('rollup').RollupOptions} */ options) {
|
|
if (Array.isArray(options.output)) {
|
|
options.output = options.output.map(output => ({
|
|
...output,
|
|
// Stops bundling to a single file and prevents bundle size issues
|
|
preserveModules: true,
|
|
preserveModulesRoot: 'src',
|
|
// Enables sourcemaps
|
|
sourcemap: true,
|
|
// Add interop for CJS
|
|
...(output.format === 'cjs' && { interop: 'compat' }),
|
|
}));
|
|
|
|
return options;
|
|
}
|
|
|
|
throw new Error('"options.output" should be an array');
|
|
}
|
|
|
|
module.exports = getRollupOptions;
|