wix-style-react
Version:
wix-style-react
15 lines (11 loc) • 381 B
JavaScript
module.exports = (file, api, options) => {
const j = api.jscodeshift;
const root = j(file.source);
const imports = root.find(j.ImportDeclaration).paths();
const { ComponentName } = options;
j(imports[imports.length - 1]).insertAfter(
`// This import was added by the component generator
import './${ComponentName}/index.story';`,
);
return root.toSource();
};