Skip to content

Commit

Permalink
fix(download-types): default webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-pribilinskiy committed Jan 9, 2024
1 parent c5ab635 commit 44366ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,15 @@ Or it can be added to `package.json`:
### CLI options

#### download-federated-types
| Option | Default value | Description |
|-------------------------------|-------------------|---------------------------|
| `--webpack-config` | `webpack/prod.ts` | Path to webpack.config.js |
| Option | Default value | Description |
|-------------------------------|---------------------|---------------------------|
| `--webpack-config` | `webpack.config.js` | Path to webpack.config.js |

If the config is written in TypeScript, the script should be called with `npx ts-node`.
If the config is written in TypeScript, the script should be called with `ts-node`. _Example:_

```
ts-node node_modules/bin/download-federated-types --webpack-config webpack/prod.ts
```

#### make-federated-types
| Option | Default value | Description |
Expand Down
2 changes: 1 addition & 1 deletion src/bin/__tests__/download-federated-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ describe('download-federated-types', () => {
require('../download-federated-types');
});

expect(mockGetOptionsFromWebpackConfig).toHaveBeenCalledWith('webpack/prod.ts');
expect(mockGetOptionsFromWebpackConfig).toHaveBeenCalledWith('webpack.config.js');
expect(mockConsoleError).toHaveBeenCalledWith('One or more remote URLs are invalid:', remoteEntryUrls);
expect(process.exit).toHaveBeenCalledWith(1);
});
Expand Down
2 changes: 1 addition & 1 deletion src/bin/make-federated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const argv = parseArgs<Argv>(process.argv.slice(2), {
} as Partial<Argv>,
});

const webpackConfigPath = argv['webpack-config'] || 'webpack/prod.ts';
const webpackConfigPath = argv['webpack-config'] || 'webpack.config.js';
const federationConfig = webpackConfigPath
? getOptionsFromWebpackConfig(webpackConfigPath).mfPluginOptions as unknown as FederationConfig
: getFederationConfig(argv['federation-config']);
Expand Down

0 comments on commit 44366ba

Please sign in to comment.