@webspatial/next-plugin
v0.1.9
Published
`pnpm i -D @webspatial/next-plugin`
Keywords
Readme
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
