All jobs

Migrate a Vue CLI Project to Vite

Yes. An agent replaces vue-cli-service with Vite in a Vue 3 app, fixes the imports, HTML template and lint setup that break, and opens a PR with the app running.

Run this on RushOpens the console with this prompt ready to send, in a Project that has your repository.

What the agent does

The agent lists everything in the repository that exists because of Vue CLI, since removing one package orphans the rest. In an app like bezkoder/vue-3-crud that is the three scripts in package.json, all of them vue-cli-service; the devDependencies @vue/cli-service, @vue/cli-plugin-babel, @vue/cli-plugin-eslint, @vue/compiler-sfc and babel-eslint; babel.config.js with the CLI's preset; vue.config.js, which only sets devServer.port to 8081; an eslintConfig block whose parser is babel-eslint; a browserslist field; and public/index.html, which contains <%= BASE_URL %> and <%= htmlWebpackPlugin.options.title %>. It records the baseline too. On Node 22, npm run build fails with error:0308010C:digital envelope routines::unsupported from the CLI's webpack 4, and compiles once NODE_OPTIONS=--openssl-legacy-provider is set.

It removes the CLI packages and installs vite and @vitejs/plugin-vue, and watches what else moves. The lockfile held Vue 3.0.11 under a ^3.0.0 range, and the plugin's peer requirement starts at 3.2.25, so the install lifts Vue to the newest 3.x. That is inside the declared range and unavoidable, and the agent names it as a second change riding along with the first. Since those newer Vue releases include the single-file component compiler, the separate @vue/compiler-sfc entry is dropped. public/index.html moves to the repository root, the two template expressions become a literal path and title, and a module script tag points at /src/main.js.

The first Vite build fails with three UNRESOLVED_IMPORT errors, all in src/router.js: the lazy routes import ./components/TutorialsList, ./components/Tutorial and ./components/AddTutorial without an extension. Webpack was configured to try .vue; Vite is not, by design. The agent adds the extension to each import instead of widening resolve.extensions, then searches the rest of src for the patterns that are fine in this repository and break in others: require( calls, process.env.VUE_APP_ variables, process.env.BASE_URL passed to the router, and the @/ alias. It carries the dev port into vite.config.mjs as server.port, because a backend's CORS allow-list or a teammate's bookmark may depend on 8081.

Linting needs its own repair. vue-cli-service lint is gone with the service, and plain eslint --ext .js,.vue src reports eight parsing errors, one per file, each Cannot find module 'babel-eslint'. Setting parserOptions to ecmaVersion: 2020 with sourceType: "module" lets the default parser handle the dynamic imports, and the same files pass. Last, it checks the app as a user would. It starts a stub for the API that src/http-common.js expects on port 8080, runs vite, and loads the list, the add form and a detail route by direct URL to confirm that history-mode routing still falls back to index.html.

Start it with one API call

POST https://api.phoenix.so/o/{org}/sessions with this body:

{
  "agent": "claude",
  "input": "Migrate this Vue 3 project from Vue CLI to Vite. First list everything that depends on Vue CLI: scripts, packages, babel.config.js, vue.config.js and each option it sets, the eslintConfig, the browserslist field, and every template expression in public/index.html. Record the baseline: npm ci, then the build and lint scripts on the installed Node, with output. If the build fails with a digital envelope routines error, build once with NODE_OPTIONS=--openssl-legacy-provider for reference only. Remove the Vue CLI packages and add vite and @vitejs/plugin-vue. Report every other package whose installed version changed as a result, Vue itself included, and why. Move index.html to the root, replace the template expressions, add the module script tag, and carry each vue.config.js option into the Vite config. Build, and fix each failure at its source: add missing .vue extensions to imports, and do not extend resolve.extensions. Search src for require(, process.env, VUE_APP_ and the @/ alias and convert each use. If the browserslist field names browsers Vite's default target excludes, stop and ask before adding the legacy plugin. Replace the lint script with a direct eslint command and make it pass without disabling rules. The project has no tests, so verify in the browser: write a small stub for the API the HTTP client calls, start the dev server on the same port as before, and load every route directly by URL, including one with a parameter; take a screenshot of each. Open a pull request with the output of every command, the screenshots, a before and after listing of dist/, and a list of anything Vue CLI did that Vite does not.",
  "resources": [
    {
      "url": "https://github.com/your-org/your-app"
    }
  ]
}
  1. Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
  2. Send the request. POST the body in request.json to https://api.phoenix.so/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
  3. Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.

What comes back

A pull request that deletes babel.config.js and vue.config.js, adds vite.config.mjs, moves index.html, edits three import lines in src/router.js, and rewrites the scripts, devDependencies and eslintConfig in package.json along with the lockfile. The description starts with the inventory of CLI-dependent items and marks each one as replaced, moved or deleted, so a reviewer can confirm that nothing was left pointing at a package that is no longer installed.

It then reports the side effects honestly. The Vue version in the lockfile changed, and the description states the old and new numbers. The output directory keeps its name, but its contents move from dist/js and dist/css to hashed files under dist/assets. Babel and core-js are gone, which means the build no longer transpiles or polyfills for the browsers in browserslist; the description says what the new target is and that older browsers are no longer served.

The screenshots and the lint output are the acceptance evidence, since there is no test suite to lean on. A reviewer opens each screenshot, checks that the detail route was loaded by URL and not by clicking through, and reads the lint section to see that the fix was a parser setting and not a set of disabled rules. Anything that deploys the app is then checked against the new file layout before merge.

Run it on every repository still on Vue CLI

The migration runs once for each repository, at a time its owner chooses. Send the body to POST /o/{org}/sessions from a terminal or an MCP client with a request_id, a UUID made for the job, and let it work. If the run finishes its turn with a decision to make, such as whether dropping legacy browser support is acceptable, answer through POST /o/{org}/sessions/{id}/messages. The parked sandbox resumes with the dependencies installed and the stub API still on disk.

Teams that created many small Vue apps from the same template can send the same body for each repository from a script, each with a request_id that is a UUID v5 of the repository's full name. The key starts as many as its concurrency limit allows and queues the others. As each run completes, the webhook_url set on that key receives run.completed with the session URL, and the session lists the pull request.

The use case this job follows, with its automation and trigger: Hand off a long task.

Why run it on Rush?

A project on Vue CLI 4 may not build at all on the Node version a new laptop or CI image comes with, so the person doing the migration first has to recreate an old environment to learn what correct output looks like. The agent's sandbox makes that cheap. It reproduces the failure, builds the reference with the legacy flag, and then moves forward. Each of those steps is kept with its output in the transcript at GET /o/{org}/sessions/{id}/messages.

With no tests in the repository, the remaining proof is the running app, and that takes a browser and a backend. The sandbox has the first and the agent writes a stand-in for the second, so every route is loaded and captured without anyone starting three processes on their own machine. The developer who sent the request reads a pull request with screenshots instead of spending an afternoon on build tooling.

Frequently asked questions

Why do imports without .vue stop working?

Vue CLI's webpack configuration includes .vue in the extensions it tries when a path has none. Vite's default list leaves it out on purpose, because guessing extensions slows resolution and confuses editor tooling. Adding the extension to each import is the recommended fix and works in both tools, so it can even be merged ahead of the migration.

What happens to my VUE_APP_ environment variables?

They stop being injected. Vite exposes variables prefixed with VITE_ on import.meta.env and does not define process.env in browser code. The agent renames each variable where it is read and lists the names that must change in your .env files and hosting settings. The fixture this page was written against reads none.

Do I lose Babel and browser polyfills?

Yes, unless you add them back. Vite transpiles for modern browsers and does not read browserslist or inject core-js. If you must support older browsers, the official legacy plugin for Vite restores transpiled bundles and polyfills; the agent asks before adding it, since it increases build time and output size.

Will the dev server port and proxy settings carry over?

The agent maps each devServer option in vue.config.js to its Vite counterpart under server. A port moves directly. A proxy table has a similar shape but different option names for rewriting paths, so each entry is converted and then exercised with a real request against the stub.

More Vue CLI jobs

More jobs like this: Hand off a long task

Keep reading