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-generator
command to your package"scripts": { "export": "next build && next export", "build-cordova": "nextjs-cordova-generator" ... }
- Run in your project
next export
, this command will createout
directory - Run
npm run build-cordova
, this command will createwww
directory andconfig.xml
file 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 browser
cordova platform add android
cordova platform add ios
And with these commands you can run these platforms
cordova run browser
cordova run android
cordova 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