next.js
09c0065c - fix(create-next-app): add --no-import-alias for non-interactive (#62035)

Commit
1 year ago
fix(create-next-app): add --no-import-alias for non-interactive (#62035) ### What? The [create-next-app documentation](https://nextjs.org/docs/app/api-reference/create-next-app#non-interactive) under API reference says that; > Further, you can negate default options by prefixing them with --no- (e.g., --no-eslint). When I tried to use --no-import-alias, I thought that it would automatically use the default alias (@/*), but it does not. ### Why? Each option has --no prefix control but import-alias has no --no prefix control to give default value to program. In an [Interactive](https://nextjs.org/#interactive) approach, the user can select a prompt; `Would you like to customize the default import alias (@/*)? No / Yes.` If the user selects no, then the default alias is applied with @/*. ### How? Implementing a condition solve the problem for general purpose. If arguments includes `--no-import-alias` then the importAlias section automatically apply the default value. --------- Co-authored-by: JJ Kasper <jj@jjsweb.site> Co-authored-by: Steven <steven@ceriously.com>
Author
Parents
Loading