リリースノート

v1.4.0

Minor

  • Feature: You can now customize the directories names (see PR #2748)
  • Feature: add static.prefix (PR #2755)
  • Feature: you can now add a layout with a module (see PR #2790)
  • Hooks: add context as third parameter of render:route hook (PR #2754)
  • Multiple policy support for Content-Security-Policy #2736
  • Inject ssrContext into createRouter and createStore (see PR #2831)

Fixes

  • fix: add the possibility to set staging environment via NODE_ENV (PR #2742)
  • Fix: Changing only the query on a non-dynamic component was not updating page data (fix #2737)

Misc

  • Refactor cli (PR #2783)

Thanks

Big thank you too all the contributors for these amazing pull requests 👏

v1.3.0

Minor

  • Add SPA fallback template, this is a killer feature for static generated websites, please read #2690
  • Check expected node version #2718
  • Support scrollBehaviour with transitions (fix #1376), big thank you to @homerjam for his help on this!

Fixes

  • Support auto import of .jsx files (PR #2696)

v1.2.1

Fixes

  • fix: Add postcss-import-resolver in dependencies

v1.2.0

Minor changes

Patches

  • Fix: redirect to external urls works with nuxt generate now (fix #2570)
  • Fix: ssrContext.error is not a function (PR #2610)
  • Fix: Add aliases (~, ~~, @ and @@) to postcss-import #2617 (fix #1453)
  • Fix: error undefined on plugins error for server-side (https://github.com/nuxt/nuxt.js/commit/00f98c150fe03b707bcc5949e66152a5b69dd234)
  • Fix: multiple components in one route (PR #2679)
  • Fix: resolve exact route prior to index (PR #2673)
  • Fix: Handle redirect in middleware to avoid calling asyncData & fetch, fix #542 and #2665

Examples

v1.1.1

Patches

  • fix(module): default module options to empty object
  • misc: use console.warn for warnings
  • style: format with prettier
  • fix: logError is not a function #2577.
  • fix: exit with code (0) on successful nuxt-build #2569.
  • fix: regression with module.addVendor with array #2574.
  • test: add failing test for #2574

v1.1.0

Improvements

  • Many improvements for better CLI error handling
  • CLI commands exit with code (1) on any unwanted error with modules (Except nuxt dev)

Minor

  • Add support for CSP script-src safe inline (PR #2549) via render.csp option in nuxt.config.js
  • Align nuxt-start package.json with main package.json (PR #2556) (nuxt-start is still WIP)

Patches

  • fix: Prioritize nested node_modules, fix #2558
  • fix: Nested redirect in spa mode
  • fix: Cannot read property 'call' of undefined when extractCSS is true, fix #2551
  • fix: Improve loading bar to handle page redirects (even to origin page), fix #2563

v1.0.0

1.0.0 is out! :tada:

It's been a long run and we are really proud to announce the official 1.0 release. Thank you so much for your support and we are looking forward to hear your feedback :heart:

Medium article: https://medium.com/@nuxt_js/nuxt-js-1-0-is-out-bab1af459972

Breaking changes

:warning: Minimum Node.js version required for Nuxt.js is also increased to 8.0.0 (Current LTS). This allows notable security and performance improvements for both Nuxt and SSR rendering by using native async/awaits and making development easier. So don't forget to upgrade Node to the latest version in both server and your local environment ;)

We have a new internal hook system now, some modules can be broken with 1.0 if they were relying on this.nuxt.plugin(), instead, they will have to use this.hook(), see module hooks documentation.

We removed the internal extensions for .ts, if you want to use TypeScript into Nuxt.js, we recommend you to check out our typescript example.

Deprecation

For the below depreciation, it will still work but you will get a warning to tell you to change your code to the new value.

For better bundling experience for server-side and client-side, we deprecated context.isClient and context.isServer in flavor of process.client and process.server. Since these variables comes from our webpack configuration, it will optimize your client-side and server-side bundles magically :nail_care:

We also deprecated dev property inside build.extend() in flavour of isDev.

Features

  • We are now ignoring files starting with a - in front of its filename (example: pages/-ignored.vue) (PR #2417)
  • Layout transitions #1620
  • Add route.meta (array of matched page .meta) into context, useful for middleware (see details)
  • Middleware: you can now define middleware as a function, see example
  • Store: you now have access to this.$router and this.app inside your store actions!
  • You can set body: true, in your head.script[] to move your scripts at the end of <body> (see example)
  • nuxt generate --no-build: Useful for conditions when just dynamic routes are being changed. This makes incremental builds much faster.
  • Hooks: you can extend even further Nuxt by using hooks now, the documentation is coming soon.
  • New configuration: build.styleResources, check out our style-resources example.

Improvements

  • Upgrade Vue to 2.5.x #1723 #1868
  • Upgrade to Vue-Router & Vuex to 3.0
  • No more babel warning #1698
  • Adds support for folders in /layouts #1865
  • Mode spa: Respect mounted hook on first render (fix #1629)
  • Add --version & -v flag to nuxt binary (you can do npx nuxt -v to know which version of nuxt.js you are using in your project) #1840
  • Improve error message when a plugin is not found #1846
  • Add ENV variable into app.html, corresponds to env from your nuxt.config.js
  • Context is shared across plugins and pages (useful for axios interceptor with redirect), it also improves perfs!
  • Improved plugins system
  • Better nuxt dev experience with faster and more stable reloads
  • SSR performance improvements thanks to node async/awaits
  • Allow redirects to external URL (#2265)
  • Support options.modulesDir as Array
  • Upgraded uglifyjs with parrallel options as default for faster builds

Fixes

v1.0.0-rc11

Fix

v1.0.0-rc10

Improvements

  • Add resourcesLoaded plugin for Renderer #1586
  • Fix: rename context.serverState to context.nuxtState #1600
  • Fix: Handle synchronous components attached to routes

v1.0.0-rc9

Features

  • Add context.nuxtState (only on client-side and universal mode), equals to window.__NUXT__, useful for plugins which are using beforeNuxtRender hook

Fix

v1.0.0-rc8

Features

  • We now use Vuex 2.4.0 which allow us to bind context into actions and mutations! If you use official axios-module you can now use:
export default {
  actions: {
    async getProfile({ commit }) {
       const profile = await this.$axios.$get('user/profile')
       // Also app context is available using `this.app`
    }
  }
}

Improvements

  • Fix compile error when using scrollBehavior #1517
  • Fix maximum call stack size exceeded #582
  • Match correct route when resolveComponents in hash mode #1532
  • Remove bulma in dependencies #1531
  • Disable ModuleConcatenationPlugin as of some problems with resource hints #1508
  • Use `css-loader@0.28.6, you can now use~/assets/...into your