Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 839 Bytes

File metadata and controls

42 lines (28 loc) · 839 Bytes

install

pnpm i -D @webspatial/next-plugin

import withWebspatial from '@webspatial/next-plugin';

const nextConfig: NextConfig = withWebspatial()({
    // other config
});

in package.json, make sure concurrently is installed

"scripts":{
  "dev:all":"concurrently \"next dev\"  \"XR_ENV=avp next dev \" ",
  "build:all": "next build && XR_ENV=avp next build"
}

if you are using react-router, please set basename like this

const basename = process.env.XR_ENV === 'avp' ? '/webspatial/avp' : '/'
function App() {
  return <Router basename={basename}>// other logic</Router>
}

typescript support

create a env.d.ts file and add /// <reference types="@webspatial/next-plugin" />

dev

run npm run dev:all will startup the devServer

build

run npm run build:all will build the output