create-remix
create-react-router
CLI 來啟動新專案。
create-remix
CLI 將會建立一個新的 Remix 專案。不傳遞任何引數,這個指令將會啟動一個互動式 CLI 來設定新的專案,並將其設定在指定的目錄中。
npx create-remix@latest
您可以選擇性地傳遞所需的目錄路徑作為引數
npx create-remix@latest <projectDir>
預設應用程式是一個使用內建 Remix 應用程式伺服器的 TypeScript 應用程式。如果您希望根據不同的設定建立應用程式,您可以使用 --template
旗標
npx create-remix@latest --template <templateUrl>
要取得可用指令和旗標的完整清單,請執行
npx create-remix@latest --help
create-remix
也可以使用各種套件管理器來調用,讓您可以選擇 npm、Yarn、pnpm 和 Bun 來管理安裝過程。
npm create remix@latest <projectDir>
# or
yarn create remix@latest <projectDir>
# or
pnpm create remix@latest <projectDir>
# or
bunx create-remix@latest <projectDir>
create-remix --template
如需有關可用範本的更完整指南,請參閱我們的範本頁面。
有效的範本可以是
:username/:repo
或 :username/:repo/:directory
https://github.com/:username/:repo
或 https://github.com/:username/:repo/tree/:branch/:directory
:branch
)不能有 /
,因為 create-remix
無法區分分支名稱和目錄路徑https://example.com/remix-template.tar.gz
./path/to/remix-template
./path/to/remix-template.tar.gz
npx create-remix@latest ./my-app --template remix-run/grunge-stack
npx create-remix@latest ./my-app --template remix-run/remix/templates/remix
npx create-remix@latest ./my-app --template remix-run/examples/basic
npx create-remix@latest ./my-app --template :username/:repo
npx create-remix@latest ./my-app --template :username/:repo/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/tree/:branch/:directory
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/archive/refs/tags/:tag.tar.gz
npx create-remix@latest ./my-app --template https://github.com/:username/:repo/releases/latest/download/:tag.tar.gz
npx create-remix@latest ./my-app --template https://example.com/remix-template.tar.gz
npx create-remix@latest ./my-app --template ./path/to/remix-template
npx create-remix@latest ./my-app --template ./path/to/remix-template.tar.gz
create-remix --overwrite
如果 create-remix
偵測到範本和您要建立應用程式的目錄之間有任何檔案衝突,它會提示您確認是否可以將這些檔案覆寫為範本版本。您可以使用 --overwrite
CLI 旗標來跳過此提示。