[[Turbopack]]の使い勝手を試してみた。 ## 前提 - [[Windows 10]] ## プロジェクト作成 https://turbo.build/pack/docs ```console $ npx create-next-app --example with-turbopack npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. Need to install the following packages: create-next-app Ok to proceed? (y) y √ What is your project named? ... playwright-sample Creating a new Next.js app in C:\Users\syoum\work\playwright-sample. Downloading files for example with-turbopack. This might take a moment. Installing packages. This might take a couple of minutes. npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. > postinstall > npm run tailwind npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead. > tailwind > tailwindcss -i styles/globals.css -o styles/dist.css Rebuilding... Done in 192ms. added 460 packages, and audited 461 packages in 2m 93 packages are looking for funding run `npm fund` for details found 0 vulnerabilities Initialized a git repository. Success! Created playwright-sample at C:\Users\syoum\work\playwright-sample Inside that directory, you can run several commands: npm run dev Starts the development server. npm run build Builds the app for production. npm start Runs the built app in production mode. We suggest that you begin by typing: cd playwright-sample npm run dev ``` `playwright-sample`という名前は、ちょうど[[Playwright]]用のサンプルプロジェクトを作ろうと思っていたので。 ``` $ cd playwright-sample $ npm run dev ``` http://localhost:3000 にアクセスするとページが表示される。サンプルページとは思えないほど気合入っててビビった。 > [!hint]- [[Next.js]]以外の対応状況について > > > As of today, Turbopack can be used in Next.js v13. In the future we will be releasing a standalone CLI, plugin API, and support for other frameworks such as Svelte and Vue. For now, please follow these instructions to get started: > > 今のところ[[Next.js]]を使うのが必須らしい。将来的に[[Turbopack]]単体のCLIや、[[Svelte]]、[[Vue]]にも対応予定とのこと。 ## スピードについて 意外と初回よりも更新時の方が時間かかる。 ```console ready - started server on 0.0.0.0:3000, url: http://localhost:3000 event - initial compilation 4.335ms event - updated in 1248ms ```