nextjs-cordova v1.0.3
nextjs-cordova
This package help you to run nextjs application in cordova
Requirements packages
Troubleshooting
To successfully use our package, you need to use the next export command, this command adds some restrictions in the form of a ban on the use of getServerSideProps methods, you can read referer NextJS docs
Steps required
Install cordova: (npm -g cordova or yarn global add cordova)
Install this package (npm install --save-dev nextjs-cordova or yarn add -D nextjs-cordova)
- Before all you need to add
nextjs-cordova-generatorcommand to your package"scripts": { "export": "next build && next export", "build-cordova": "nextjs-cordova-generator" ... } - Run in your project
next export, this command will createoutdirectory - Run
npm run build-cordova, this command will createwwwdirectory andconfig.xmlfile for cordova core
Cordova core
You can get acquainted with cordova technology on the official documentation page
Within your application, it will be enough for you to know these commands Add cordova platforms for project:
cordova platform add browsercordova platform add androidcordova platform add ios
And with these commands you can run these platforms
cordova run browsercordova run androidcordova run ios
Tidy up
Be sure to hide the following folders from linters, tyescript, and git etc
Typescript:
Add the following to your .tsconfig file:
"exclude": ["out", "www", "platforms"],Git:
Add the following to your .gitignore file:
**/platforms/*
**/out/*
**/www/*Eslint:
Add the following to your .eslintignore file:
**/platforms/*
**/out/*
**/www/*
config.xml