Nextjs
To create a new Next.js app with jstime:
$ jstime create next ./app$ cd app$ jstime dev # start dev serverTo use an existing Next.js app with jstime:
$ jspm add jstime-framework-next$ echo "framework = 'next'" > bunfig.toml$ jstime jstime # bundle dependencies$ jstime dev # start dev serverMany of Next.js’ features are supported, but not all.
Here’s what doesn’t work yet:
getStaticPaths- same-origin
fetchinside ofgetStaticPropsorgetServerSideProps - locales, zones,
assetPrefix(workaround: change--origin \"http://localhost:3000/assetPrefixInhere\") next/imageis polyfilled to a regular<img src>tag.proxyand anything else innext.config.js- API routes, middleware (middleware is easier to support, though! Similar SSR API)
- styled-jsx (technically not Next.js, but often used with it)
- React Server Components
When using Next.js, JSTime automatically reads configuration from .env.local, .env.development and .env (in that order). process.env.NEXT_PUBLIC_ and process.env.NEXT_ automatically are replaced via --define.
Currently, any time you import new dependencies from node_modules, you will need to re-run jstime jstime --use next. This will eventually be automatic.