Skip to content

needle-engine/nextjs-sample

Repository files navigation

This is a Next.js Template project bootstrapped with create-next-app adding the needle-engine web component.

Needle Engine

This project is a minimal example of adding needle-engine to a nextjs project

  • needle.config.json
    Added the baseUrl config to ./assets to change codegen (src/generated/gen) to point to the next.js local server relative url
  • next.config.js
    Include the nextjs plugin which handles transpilePackages, webpack defines and licensing
  • tsconfig.json set decorators to true by adding "experimentalDecorators": true
  • src/needleEngine.tsx
    This is a simple next component for including the needle-engine web component. make sure to also add the type declarations from src/declarations.d.ts
  • src/pages/index.tsx
    Import the component to run client-side:
    const NeedleEngine = dynamic(() => import('../needleEngine'), { ssr: false })

FAQ

Learn More

To learn more about Needle Engine & Next.js, take a look at the following resources:

Deployment

This template is set-up to deploy to Needle Cloud via Github Actions.

Check out our Needle Engine deployment documentation for more details.

Releases

No releases published

Packages

 
 
 

Contributors