Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/create-next-app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ async function run(): Promise<void> {
if (ciInfo.isCI) {
// We don't use preferences here because the default value is @/* regardless of existing preferences
program.importAlias = defaults.importAlias
} else if (process.argv.includes('--no-import-alias')) {
program.importAlias = defaults.importAlias
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently our non-interactive tests specify the --import-alias="@/*" arg but this seems like a good alternative so the default doesn't need to be known. Could you update one of the tests doing the previous behavior with this instead?

x-ref:

} else {
const styledImportAlias = blue('import alias')

Expand Down
2 changes: 1 addition & 1 deletion test/integration/create-next-app/templates-app.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ describe('create-next-app --app', () => {
'--app',
'--eslint',
'--src-dir',
'--import-alias=@/*',
'--no-import-alias',
],
{
cwd,
Expand Down
2 changes: 1 addition & 1 deletion test/integration/create-next-app/templates-pages.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ describe('create-next-app templates', () => {
'--eslint',
'--src-dir',
'--no-app',
`--import-alias=@/*`,
`--no-import-alias`,
],
{
cwd,
Expand Down