change invariant for generateExtraFiles
@@ -231,14 +231,13 @@ class RelayFileWriter implements FileWriterInterface {
if (this._config.generateExtraFiles) {
const configDirectory = this._config.outputDir;
+ this._config.generateExtraFiles(dir => {
+ const outputDirectory = dir || configDirectory;
invariant(
- configDirectory,
+ outputDirectory,
'RelayFileWriter: cannot generate extra files without specifying ' +
- ' an outputDir in the config.',
+ 'an outputDir in the config or passing it in.',
);
-
- this._config.generateExtraFiles(dir => {
- const outputDirectory = dir || configDirectory;
let outputDir = allOutputDirectories.get(outputDirectory);
if (!outputDir) {
outputDir = addCodegenDir(outputDirectory);
