Packages a next.js website built using next export to be compatible with a Cordova project.
This does the following:
- Renames the
_next/folder tonext/, along with all references in source code - Copies any source maps created in
next buildbut missing fromnext export - (future work...)
npm install --save-dev github:datalink/next-static-export-cordovaHighly recommended: you should also install next-static-export-fix-csp-quotes to handle fixing
your content security policy. See https://github.com/datalink/next-static-export-fix-csp-quotes.
In your package.json, add it to the end of your build process as follows:
{
"scripts": {
"build": "next build && next export && next-static-export-cordova",
}
}After running this, your /out directory can be copied into your cordova project's /www directory.