egillanton / shopify-nextjs-template

Shopify app template built with Next.js (custom server) for Shopify CLI v2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v3 implementation

If you are looking for a v3 implementation, switch branch to v3.

Requirements

Installation

  • Install dependencies
$ yarn install
  • Connect it through CLI v2 to a manually created app in your partner dashboard:
$ shopify app connect
  • Run:
$ shopify app serve

Production

  • Build the production bundle using the following command:

    $ yarn build

    Note that Next.Js checks typescript correctness and this previous command will fail if you have any typescript errors in your code. I suggest fixing the errors, but if you want to bypass typescript and still build your app, go to next.config.js and add the following code to your modules.exports object as indicated in the official docs

    const moduleExports  = {
        typescript: {
            // !! WARN !!
            // Dangerously allow production builds to successfully complete even if
            // your project has type errors.
            // !! WARN !!
            ignoreBuildErrors: true,
        },
    
        ...(the rest of your configuration)
    }
  • Then run this command to start the server with NODE_ENV=production:

$ yarn start

License

This respository is available as open source under the terms of the MIT License.

About

Shopify app template built with Next.js (custom server) for Shopify CLI v2.

License:MIT License


Languages

Language:TypeScript 96.9%Language:JavaScript 3.1%