Contributions are always welcome, no matter how large or small. Before contributing, please read the code of conduct.
Install npm on your system: https://www.npmjs.com/get-npm
git clone https://github.com/lukeocodes/nuxt-starter-netlify-cms
npm install
To launch Nuxt in development mode with hot module replacement on http://localhost:3000
:
npm run dev
Starts the netlify dev environment, including the Nuxt Development Environment. For more infor check the Netlify Dev Docs
netlify dev
These are included in your package.json
.
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start",
"generate": "nuxt generate"
}
You can run different commands depending on the target:
- nuxt dev - Launch the development server.
- nuxt build - Build and optimize your application with webpack for production.
- nuxt start - Start the production server (after running
nuxt build
). Use it for Node.js hosting like Heroku, Digital Ocean, etc.
- nuxt dev - Launch the development server.
- nuxt generate - Build the application (if needed), generate every route as a HTML file and statically export to
dist/
directory (used for static hosting). - nuxt start - serve the
dist/
directory like your static hosting would do (Netlify, Vercel, Surge, etc), great for testing before deploying.
Nuxt.js lets you choose between Server or Static deployments.
To deploy a SSR application we use target: server
, where server is the default value.
npm run build
Nuxt.js will create a .nuxt
directory with everything inside ready to be deployed on your server hosting.
We recommend putting
.nuxt
in.npmignore
or.gitignore
.
Once your application is built you can use the start
command to see a production version of your application.
npm run start
Nuxt.js gives you the ability to host your web application on any static hosting.
To deploy a static generated site make sure you have target: static
in your nuxt.config.js
.(For Nuxt >= 2.13:)
export default {
target: 'static'
}
npm run generate
Nuxt.js will create a dist/
directory with everything inside ready to be deployed on a static hosting service.
As of Nuxt v2.13 there is a crawler installed that will now crawl your link tags and generate your routes when using the command nuxt generate
based on those links.
Warning: dynamic routes are ignored by the
generate
command when using Nuxt <= v2.12: API Configuration generate
When generating your web application with
nuxt generate
, the context given to asyncData and fetch will not havereq
andres
.
To return a non-zero status code when a page error is encountered and let the CI/CD fail the deployment or build, you can use the --fail-on-error
argument.
npm run generate --fail-on-error
We actively welcome your pull requests!
If you need help with Git or our workflow, please ask on Gitter.im. We want your contributions even if you're just learning Git. Our maintainers are happy to help!
Netlify CMS uses the Forking Workflow + Feature Branches. Additionally, PR's should be rebased on master when opened, and again before merging.
- Fork the repo.
- Create a branch from
main
. If you're addressing a specific issue, prefix your branch name with the issue number. - If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Run
npm run test
and ensure the test suite passes. (Not applicable yet) - Use
npm run lint
to format and lint your code. - PR's must be rebased before merge (feel free to ask for help).
- PR should be reviewed by two maintainers prior to merging.
By contributing to the Nuxt - Netlify CMS starter, you agree that your contributions will be licensed under its MIT license.