From 085a6219ceb89052ac0a269e7ccda081e534a800 Mon Sep 17 00:00:00 2001 From: Takashi MIMA <29667656+task4233@users.noreply.github.com> Date: Thu, 19 Aug 2021 04:17:45 +0900 Subject: [PATCH] fix(create-vite): project name with only numbers as an argument (#4606) --- packages/create-vite/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/create-vite/index.js b/packages/create-vite/index.js index 4c5879bdd0bd12..efcf63cb6a8629 100755 --- a/packages/create-vite/index.js +++ b/packages/create-vite/index.js @@ -3,7 +3,9 @@ // @ts-check const fs = require('fs') const path = require('path') -const argv = require('minimist')(process.argv.slice(2)) +// Avoids autoconversion to number of the project name by defining that the args +// non associated with an option ( _ ) needs to be parsed as a string. See #4606 +const argv = require('minimist')(process.argv.slice(2), { string: ['_'] }) // eslint-disable-next-line node/no-restricted-require const prompts = require('prompts') const {