Nuxt is an intuitive and extendable way to create type-safe, performant and production-grade full-stack web apps and websites with Vue 3.
Go to file
Sébastien Chopin 917adc0618
feat: options.target and full-static export (#6159)
* feat: add options.target

* fix(lint): lint

* fix(test): update snapshots

* fix(builder): default value for target

* fix(test): fix test

* fix(test): test fixing

* fix: use this.options.target

* fix: final test

* Update packages/vue-renderer/src/renderer.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: Add target option and update banner

* fix(lint): fix

* feat: Add warning when using serverMiddleware in static target

* chore(utils): add TARGETS and MODES as constants

* hotfix: lint

* chore(module): add filename as alias of fileName

* feat: introducing nuxt export and router/routes.json

* hotfix: Fix the linting lord

* chore(core): add comment for filename vs fileName

* fix: use targets constant

* chore: remove warning

* fix: unit testing

* wip: refactor and use TARGETS

* fix: lint

* feat: add target as alias for first arg value

* fix: generate only for SPA

* chore: explain to use nuxt static X

* fix: render SPA fallback on redirect for static target

* fix: lint issue

* fix: only target is useful for now

* wip

* wip: nuxt static export is looking good

* Update packages/generator/src/generator.js

Co-Authored-By: Devon Rueckner <indirectlylit@users.noreply.github.com>

* Update packages/cli/src/options/common.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: add options.target

* fix(lint): lint

* fix(test): update snapshots

* fix(builder): default value for target

* fix(test): fix test

* fix(test): test fixing

* fix: use this.options.target

* fix: final test

* Update packages/vue-renderer/src/renderer.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* feat: Add target option and update banner

* fix(lint): fix

* feat: Add warning when using serverMiddleware in static target

* chore(utils): add TARGETS and MODES as constants

* hotfix: lint

* chore(module): add filename as alias of fileName

* feat: introducing nuxt export and router/routes.json

* hotfix: Fix the linting lord

* chore(core): add comment for filename vs fileName

* fix: use targets constant

* chore: remove warning

* fix: unit testing

* wip: refactor and use TARGETS

* fix: lint

* feat: add target as alias for first arg value

* chore: explain to use nuxt static X

* fix: render SPA fallback on redirect for static target

* fix: lint issue

* fix: only target is useful for now

* wip

* wip: nuxt static export is looking good

* Update packages/generator/src/generator.js

Co-Authored-By: Devon Rueckner <indirectlylit@users.noreply.github.com>

* Update packages/cli/src/options/common.js

Co-Authored-By: Alexander Lichter <manniL@gmx.net>

* fix: duplicate imports

* chore: don't server render if an error happens on static target

* test: update unit and add export

* lint: fix

* lint: fix

* fix: e2e test

* fix: fallback only for static target

* fix: dev test

* feat: add generate.crawler

* fix: full static is when generate.static is given

* chore: improvements

* fix: Add isFullStatic in nuxt/config.json

* feat: handle fetch for full static

* feat: router.prefetchPayloads for full static

* chore: use fetch in async-data example

* fix: add target only if given

* fix: use created to have access to props in fetchOnServer

* chore: add console.error in dev for easy debugging

* feat: payload smart pre-fetching

* fix: remove alias for target

* fix: increment payloadFetchIndex is static set to false

* chore: lint

* chore: add serve command

* chore: rename universal to server-side

* fix: handle payloadPath on SPA fallback

* fix: lint

* chore lint again

* feat: handle spa fallback

* feat: support string for exclude

* fix: fallback only if no extension or html

* chore: use JSON.stringify() for static target

* chore: lint again, dammit

* chore: fix tests and remove too early return

* fix: early return only for server target

* fix: update tests

* fix: unit tests

* chore: add ssr option

* chore: add logic for ssr option

* fix: #6682

* chore(dx): add next command to run

* fix: lint

* fix: tests

* chore: keep old behaviour for nuxt build in spa

* fix: test again, oh boy

* fix: alright this is good now

* chore: add comment for spa fallback

* chore: move routes.json to dot nuxt dir

* chore: simplify check for promise

* chore: unique lock id

* chore: refactor isFullStatic

* fix: dont set default in build context

* chore: add test for serve

* chore: update tests

* hotfix: lint tests

* chore(dx): improve message for bundling

* feat: js payload extraction with jsonp

* fix: keep serialized session script for legacy generate

* fix: call to setPagePayload from fetchPayload

* use devalue for payload chunks

* feat: add initial load state chunk

* feat: preload payload and state scripts

* fix(vue-app): don't re-render the app if trailing slash on SSG

* hotfix: remove console.log

* chore(dx): add deploy infos for nuxt export

Co-authored-by: Pooya Parsa <pyapar@gmail.com>

* chore: handle fetching payload.js for nuxt state

* chore(dx): error when using nuxt generate and static

* chore: remove static option for clarity

* chore: remove serverless target

* hotfix: lint

* hotfix: unit tests

* chore: update legacy js resource

* chore: remove query params from url in static target

* fix: use globalName and urlJoin

* chore: typo

* feat: previewMode 👀

* chore: rename to enablePreview

* fix: wait next tick to avoid error on spa

* chore: try 1 sec

* hotfix: test only for linux, wtf azure

* refactor: static assets

- generalize logic for modules need emit export static assets
- allow customization for version, dir and base
- serialization logic is only in ssr now

* feat: smart state chunk creates

* fix(client): ignore payload load error

* perf: avoide payload loading for spa initial

* perf: avoid loading failed chunks again

* chore(cli): add simple compression for nuxt serve

* test: update snapshots

* fix version snapshot

* fix(generator): set staticAssetsBase on context only for full static

* fix tests

* fix: honor shouldHashCspScriptSrc

* chore(dx): add log for client-side fallback creation

Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
Co-authored-by: Alexander Lichter <manniL@gmx.net>
Co-authored-by: Pooya Parsa <pooya@pi0.ir>
Co-authored-by: Devon Rueckner <indirectlylit@users.noreply.github.com>
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2020-05-07 21:08:01 +02:00
.circleci chore(deps): remove codecov (#6908) 2020-01-24 07:36:51 +00:00
.github chore(ci): only enable next pr ci for hotfix 2020-03-03 19:20:29 +00:00
benchmarks chore(benchmark): fix package.json scripts (#7205) 2020-04-17 11:08:29 +02:00
distributions chore(deps): update all non-major dependencies (dev) (#7269) 2020-05-07 09:33:52 +01:00
examples feat: options.target and full-static export (#6159) 2020-05-07 21:08:01 +02:00
packages feat: options.target and full-static export (#6159) 2020-05-07 21:08:01 +02:00
scripts chore: fix typos (#7219) 2020-04-14 11:26:40 +02:00
test feat: options.target and full-static export (#6159) 2020-05-07 21:08:01 +02:00
.all-contributorsrc chore: add pimlie into the core team (#5494) 2019-04-09 11:08:10 +01:00
.editorconfig Add editorconfig 2016-12-15 18:47:20 +01:00
.eslintignore feat: externalize typescript support (#5858) 2019-07-24 11:56:44 +04:30
.eslintrc.js global name is wrongly set to nuxt-edge (#6736) 2019-11-27 20:51:48 +01:00
.gitignore chore(ci): upload test report to CircleCI and Azure (#5802) 2019-05-25 18:47:21 +04:30
.gitpod.yml chore: Simplifies Code Contributions & Reviews (#6816) 2020-01-06 17:24:53 +01:00
.ls-lint.yml chore: add ls-lint (#7228) 2020-04-16 16:25:40 +02:00
.npmrc fix(ci): use registry.npmjs.org instead of registry.yarnpkg.com 2018-09-02 13:27:44 +04:30
.yarnrc chore: upgrade dependecies 2018-09-13 10:02:19 +01:00
azure-pipelines.yml chore(ci): separate dev test and unit test (#6737) 2019-11-27 20:15:27 +00:00
babel.config.js refactor(babel-preset-app): remove babel-plugin-dynamic-import-node (#6197) 2019-08-08 13:39:17 +04:30
CODE_OF_CONDUCT.md chore(docs): update code-of-conduct (#6719) 2019-12-04 16:29:53 +01:00
CONTRIBUTING.md doc: add CONTRIBUTING.md 2019-01-03 09:32:34 +00:00
jest.config.js chore(ci): upload coverage report to codecov (#6887) 2020-01-19 10:23:59 +00:00
lerna.json v2.12.1 2020-03-25 20:20:50 +01:00
LICENSE chore: update members in license and package.json (#5498) 2019-04-10 01:38:52 +04:30
package.json chore(deps): update all non-major dependencies (dev) (#7269) 2020-05-07 09:33:52 +01:00
README.md chore(readme): simplify readme and add gitpod in contributing (#7092) 2020-03-24 16:32:36 +01:00
RELEASE_PLAN.md chore: fix typos (#7219) 2020-04-14 11:26:40 +02:00
renovate.json chore(deps): ingore terser-webpack-plugin before v3 (requires node 10) 2020-05-07 09:17:09 +01:00
yarn.lock feat: options.target and full-static export (#6159) 2020-05-07 21:08:01 +02:00


Tests Status Azure Build Status  Coverage Status Downloads Version License Discord

Support us

Hire Nuxt

Vue.js Meta Framework to create complex, fast & universal web applications quickly.

Features

  • Automatic transpilation and bundling (with webpack and babel)
  • Hot code reloading
  • Server-side rendering OR Single Page App OR Static Generated, you choose 🔥
  • Static file serving. ./static/ is mapped to /
  • Configurable with a nuxt.config.js file
  • Custom layouts with the layouts/ directory
  • Middleware
  • Code splitting for every pages/
  • Loading just the critical CSS (page-level)

Learn more at https://nuxtjs.org.

Getting started

$ npx create-nuxt-app <project-name>

It's as simple as that!

Learn more at https://nuxtjs.org/guide/installation

Examples

Please take a look at https://nuxtjs.org/examples or directly in https://github.com/nuxt/nuxt.js/tree/dev/examples.

Production deployment

To deploy, instead of running nuxt, you probably want to build ahead of time. Therefore, building and starting are separate commands:

nuxt build
nuxt start

Learn more at https://nuxtjs.org/guide/commands#production-deployment

Consulting from the Nuxt team

Get help with that tough bug or make sure your Nuxt app is ready to deploy. For $250 an hour, get technical support, advice, code reviews, and development from the Nuxt core team: Hire Nuxt on Otechie

Professional support with TideLift

Professionally supported Nuxt.js is now available!

Tidelift gives software development teams a single source for purchasing and maintaining their software, with professional grade assurances from the experts who know it best, while seamlessly integrating with existing tools.

Get supported Nuxt with the Tidelift Subscription.

Supporting Nuxt.js

Nuxt.js is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome backers. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events.

Support us with a monthly donation and help us continue our activities. [Become a backer]

Platinum Sponsors

Open Collective Platinum Sponsors

Gold Sponsors

Open Collective Gold Sponsors

Silver Sponsors

Open Collective Silver Sponsors

Bronze Sponsors

Open Collective Bronze Sponsors

Nuxters

Open Collective Nuxters

Core team

Sébastien Chopin
Sébastien Chopin

📝 🐛 💻 🎨 📖 💬 👀 📢
Alexandre Chopin
Alexandre Chopin

🎨 📖 📋 📦 💬 📢
Pooya Parsa
Pooya Parsa

🐛 💻 🔌 💬 👀 🔧
Clark Du
Clark Du

🐛 💻 💡 👀 ⚠️ 🔧
Alexander Lichter
Alexander Lichter

💬 🐛 💻 💡 👀 ⚠️
Jonas Galvez
Jonas Galvez

💬 🐛 💻 💡 👀 ⚠️
Dmitry Molotkov
Dmitry Molotkov

💬 🐛 💻 🤔 👀
Kevin Marrec
Kevin Marrec

💻 🤔 📦 👀
Pim
Pim

🐛 💻

Contributors

Thank you to all our contributors!

Nuxt.js Contributors

Contributing

Open in Gitpod

Please refer to our Contribution Guide

Cross-browser testing

Thanks to BrowserStack!

BrowserStack

Automated testing

Thanks to SauceLabs for supporting Open Source <3

SauceLabs

Security

If you discover a security vulnerability regarding Nuxt.js, please send an e-mail to the team via security@nuxtjs.org! All security vulnerabilities will be promptly addressed.

License

MIT