Prompt to convert a Shopify export to Next.js
This prompt asks an AI coding assistant to turn a WebExport copy of a Shopify storefront into a Next.js App Router project. It rebuilds product and collection pages from the saved markup, removes cart scripts, links buy buttons to your Shopify store, and keeps only the product data that appears in the HTML.
Last reviewed
Key facts
- The saved copy has no cart or checkout, because those run on Shopify’s servers.
- Calls to /cart.js and product .js endpoints fail outside Shopify.
- Shopify’s product CSV leaves out images and collection membership, so extract product data from the saved pages instead.
- Test status: Next.js steps tested on a real export (Next.js 16.4.6), Shopify cleanup not yet tested.
The prompt
Paste this into your AI coding assistant with the unzipped export open, and replace the placeholders in square brackets.
You are helping me move a static export of a Shopify site to Next.js.
CONTEXT
- ./exported-site is a WebExport download of my Shopify site: HTML, CSS, JavaScript, fonts and images.
- Live site for comparison: [LIVE_URL]. Final domain: [DOMAIN]. Host: [HOST: Vercel, Netlify, Cloudflare Pages, Amazon S3 or Nginx].
TARGET: Next.js
- Next.js App Router project in TypeScript, one page per route in app/<route>/page.tsx, shared header and footer in app/layout.tsx.
- Assets go to public/. Load needed scripts with next/script.
- Static export: [STATIC_EXPORT: yes or no]. If yes, set output to export and keep redirects and headers in the host's files.
SHOPIFY-SPECIFIC CLEANUP
- Remove calls to /cart.js, /cart/add.js and product .js endpoints. They only exist on Shopify.
- Replace add to cart with a link to the product on [STORE_URL]. Do not build a cart or checkout.
- Keep /products/<handle> and /collections/<handle> as paths.
- Extract product data only from values present in the saved HTML. Leave missing fields empty and list them.
- Search for cdn.shopify.com. Download or replace each hit.
RULES
- Keep the design and every URL path. List path changes in REDIRECTS.md.
- Do not invent content, prices or links. Report gaps in MIGRATION_NOTES.md.
- Build after each step and ask before deleting a script or stylesheet.
START
Inventory the folder, show me a plan, wait for my go-ahead, then convert the home page only.How to run it
- Unzip the download to ./exported-site and open the project in your AI coding tool.
- Paste the prompt, approve the plan, then commit after each page that matches the live site.
What to expect from Shopify to Next.js
A Shopify storefront export holds product pages, collection pages and the assets they use. The assistant can turn those into routes and a small data file of products, as long as it uses only values that appear in the saved HTML. Anything it cannot find, such as stock or variant prices, stays blank and goes into the notes.
Decide the buying path before you start. The simplest option keeps Shopify as the store and sends buyers to it from each product page. The prompt uses a placeholder for the store address, so the assistant never guesses a checkout URL.
Questions the assistant should ask you
- What is the address of your Shopify store for buy links?
- Which product fields belong on each page, and which can stay blank?
- Should collection filters be dropped or rebuilt with a small script?
Verify the result
Run these from the project folder after each batch. The last command lists files that still refer to Shopify.
npm install
npm run build
npm run start
# pages in the export vs routes in the project
find exported-site -name "*.html" | wc -l
find app -name "page.tsx" | wc -l
# files that still refer to the old platform
grep -rlE "cdn.shopify.com|/cart.js" app public | head- next build finishes with no type or lint errors, and every old sitemap route returns 200.
- With output set to export, the out folder holds one HTML file per route.
- Click every buy button and confirm it opens the right product on your Shopify store.
- Compare ten product titles and prices with the live store.
What can go wrong
- The assistant keeps a cart drawer that calls Shopify endpoints, and add to cart silently fails. The prompt removes those calls and links to the store.
- Prices and stock are frozen at export time. Tell buyers nothing about live stock, or re-export before launch.
- A large catalog turns into hundreds of page files. Ask for a dynamic route over a products data file once the first page matches.
Frequently asked questions
Can the Next.js site take orders?
Not from the saved pages. Link buyers to your Shopify store or another checkout service. Rebuilding a cart is a separate project.
Where does the product data come from?
From the saved HTML only. The prompt tells the assistant not to invent prices, descriptions or stock, and to list any missing field.
Do collection pages keep their URLs?
Yes. The prompt keeps paths such as /collections/handle and /products/handle as routes, so existing links and search results keep working.
Should I use Shopify’s product CSV instead?
It is useful for data, but Shopify’s help says images and collections are not included. Use it next to the page export, not instead of it.
Official documentation
Free tools for this job
- No-Code Platform DetectorInstantly detect if a site is built with Webflow, Framer, Squarespace, Wix, or Shopify.
- Website Asset Size AnalyzerAnalyze all images, JS, and CSS weights to find performance bottlenecks.
- No-Code Asset Path NormalizerRewrite CDN URLs to local relative paths for offline and self-hosted deployments.
- Redirect Map BuilderBuild an old-to-final redirect mapping from URL lists.
Start with the files
The prompt works on a WebExport download. Paste your public Shopify URL into the export form and get a ZIP. The Free plan covers 1 site, 5 exports a month, 15 pages and 20 MB per export. Professional is a $9.99 one-time purchase with unlimited pages.