Skip to content

Commit 258826f

Browse files
committed
🐛 Fix generating fela index file with dependencies turned off
1 parent fc406ed commit 258826f

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default class Model {
105105

106106
let content;
107107
if (fela && !configuration.felaHooks) {
108-
content = templatesJavascript.indexFela(componentName);
108+
content = templatesJavascript.indexFela(componentName, configuration.moduleDependencies);
109109
} else {
110110
content = templatesJavascript.index(componentName);
111111
}

src/template/component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
export const index = (name) => `export { default } from './${name}';\n`;
22

3-
export const indexFela = (
4-
name
5-
) => `import { connectFela } from '../../dependencies';
3+
export const indexFela = (name, dependencies: boolean) => `${
4+
dependencies
5+
? "import { connectFela } from '../../dependencies'"
6+
: "import { connect as connectFela } from 'react-fela'"
7+
};
68
import ${name} from './${name}';
79
import * as styles from './${name}.styles';
810

0 commit comments

Comments
 (0)