* chore(react): update emotion to new versions and new package names on react plugin * chore(nextjs): update emotion to latest version and the new package names * feat(misc): have react and next plugin migrations update emotion imports * add renamePackageImports and renameNpmPackage rules to workspace utils * update migrations to update emotion imports to the new name and version
25 lines
571 B
TypeScript
25 lines
571 B
TypeScript
import * as rollup from 'rollup';
|
|
|
|
function getRollupOptions(options: rollup.RollupOptions) {
|
|
const extraGlobals = {
|
|
react: 'React',
|
|
'react-dom': 'ReactDOM',
|
|
'styled-components': 'styled',
|
|
'@emotion/react': 'emotionReact',
|
|
'@emotion/styled': 'emotionStyled',
|
|
};
|
|
if (Array.isArray(options.output)) {
|
|
options.output.forEach((o) => {
|
|
o.globals = { ...o.globals, ...extraGlobals };
|
|
});
|
|
} else {
|
|
options.output = {
|
|
...options.output,
|
|
...extraGlobals,
|
|
};
|
|
}
|
|
return options;
|
|
}
|
|
|
|
module.exports = getRollupOptions;
|