Packages

@nuxt/core

2.18.1 · 28 Jun 2024MIT164.6k / weekRepositoryHomepagenpmAtom feed

Deprecated by its maintainers: Nuxt 2 has reached EOL and is no longer actively maintained. See https://nuxt.com/blog/nuxt2-eol for more details.What to use instead
Your version

2.6.0

4 Apr 2019Where it was published

2.18.1 is the newest release of 2.x.

npm marks 2.6.0 as deprecated: Nuxt 2 has reached EOL and is no longer actively maintained. See nuxt.com/blog/nuxt2-eol for more details.

In short

1 deprecated5 new4 fixed5 changed2 internal

  • Deprecated

    postcss: Deprecate config support

Release note

The section about @nuxt/core of a note shared by several packages.

Migration Guide

This version is addressing most of the problems of 2.5 and is without any breaking changes. For most of the users, a normal version upgrade would be enough. However, reading this guide can help to have a smooth upgrade.

General Tips

  • Using yarn as the package manager is more preferred as Nuxt is internally being tested against yarn

  • Before upgrade ensure to remove yarn.lock, package-lock.json and node_modules

  • After full install and testing, also consider upgrading other dependencies. The yarn outdated command can be used.

Missing App Dependencies

Because of how package managers (yarn, npm) work, a wrong version of a dependency from one of the other dependencies may be hoisted into node_modules. Nuxt is strict about this and provides instructions for dependency resolution so please follow it.

The well-known problem is with firebase package that requires to manually install node-fetch dependency in your project.

Reverting breaking changes

We accidentially introduced a change that broke the prod build for many people who are using Nuxt programatically. This has been resolved through #5413. Sorry for the inconveniences!

Core-js

Since core-js@2 and core-js@3 are both supported from babel 7.4.0, Starting from 2.6 Nuxt supports both versions (#5411). It is highly advised to stick with 2 (default) unless having a special dependency that needs 3. (Instructions for core-js@2 are not required but recommended)

core-js@3

Edit nuxt.config.js:

export default {
  build: {
    babel: {
      presets({ isServer }) {
        return [
          [
            require.resolve('@nuxt/babel-preset-app'),
            // require.resolve('@nuxt/babel-preset-app-edge'), // For nuxt-edge users
            {
              buildTarget: isServer ? 'server' : 'client',
              corejs: { version: 3 }
            }
          ]
        ]
      }
    }
  }
}

Typescript

Nuxt 2.5 users may only require to add ts-node to the dependencies

Beta Testers : Replace nuxt by nuxt-edge, and @nuxt/typescript by @nuxt/typescript-edge in the following instructions.

  1. Remove nuxt-ts dependency (2.4 users only)

    • yarn: yarn remove nuxt-ts

    • npm: npm remove nuxt-ts

  2. Add nuxt and ts-node to dependencies:

    • yarn: yarn add nuxt ts-node

    • npm: npm i nuxt ts-node

  3. Add @nuxt/typescript to devDependencies:

    • yarn: yarn add -D @nuxt/typescript

    • npm: npm i -D @nuxt/typescript

  4. Create an empty tsconfig.json file. Nuxt will automatically generate it with defaults at first run, then you can edit it to fit your needs

Features

  • typescript: Detect typescript based on tsconfig.json

Fixes

  • Unexpected token export in importing babel runtime helper

  • core: Call ready to prevent breaking changes (Pooya Parsa)

  • build: Disable loading babel.config.js by default (#5365) (Xin Du (Clark))

  • types: Add type definition for typescript.typeCheck

Chore

  • Deprecated

    postcss: Deprecate config support

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.