Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Node-style format aliases #2783

Merged
merged 3 commits into from Apr 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/utils/mergeOptions.ts
Expand Up @@ -229,7 +229,18 @@ function getOutputOptions(
command: GenericConfigObject = {}
): OutputOptions {
const getOption = createGetOption(config, command);
const format = getOption('format');
let format = getOption('format');

// Handle format aliases
switch (format) {
case 'esm':
case 'module':
format = 'es';
break;
case 'commonjs':
format = 'cjs';
break;
}
guybedford marked this conversation as resolved.
Show resolved Hide resolved

return {
amd: { ...config.amd, ...command.amd },
Expand Down