Upgrading nuxt 1 to 2
Breaking1.4.5 โ 2.18.1Breaking17Security2Platform6Deprecated14New176Changed145Fixed469Other232
16 breaking changes and 6 platform requirement changes and 2 security fixes.
- A configuration option was renamed, so old configs using the old name need updating.
- Renames the setup hook to `run:before`.
- The legacy Nuxt variant is no longer supported.
- If you install Nuxt with npm, you need to clean up your lockfile before or after upgrading, otherwise the install may break. Yarn users should be fine, though removing yarn.lock is still recommended.
No longer states a Node.js requirement from 2.15.0 (was >=8.0.0).
Adds @nuxt/babel-preset-app 2.18.1, @nuxt/builder 2.18.1, @nuxt/cli 2.18.1, @nuxt/components ^2.2.1, @nuxt/config 2.18.1, @nuxt/core 2.18.1, @nuxt/generator 2.18.1, @nuxt/loading-screen ^2.0.4, @nuxt/opencollective ^0.4.0, @nuxt/server 2.18.1, @nuxt/telemetry ^1.5.0, @nuxt/utils 2.18.1, @nuxt/vue-app 2.18.1, @nuxt/vue-renderer 2.18.1, @nuxt/webpack 2.18.1.
Drops @nuxtjs/youch, ansi-html, autoprefixer, babel-core, babel-loader, babel-preset-vue-app, caniuse-lite, chalk, chokidar, clone, compression, connect, css-hot-loader, css-loader, debug, es6-promise, etag, extract-text-webpack-plugin, file-loader, fresh, friendly-errors-webpack-plugin, fs-extra, glob, hash-sum, html-minifier, html-webpack-plugin, launch-editor, launch-editor-middleware, lodash, lru-cache, memory-fs, minimist, opencollective, postcss, postcss-cssnext, postcss-import, postcss-import-resolver, postcss-loader, postcss-url, pretty-error, progress-bar-webpack-plugin, semver, serialize-javascript, serve-static, server-destroy, source-map, style-resources-loader, uglifyjs-webpack-plugin, upath, url-loader, vue, vue-loader, vue-meta, vue-router, vue-server-renderer, vue-template-compiler, vuex, webpack, webpack-bundle-analyzer, webpack-dev-middleware, webpack-hot-middleware, webpack-node-externals.
Installs 1296 packages in all (was 1198).
What you must change
externalsWhitelistexternalsAllowlistrun:before.run:beforenuxt-legacypackage-lock.jsonyarn.lockacornpostcssdotenvglob@nuxtjs/composition-apipostcsswebpackincludesbuild.crossoriginrender.crossoriginnuxt.ready()Nuxtbuild.useForkTsCheckerbuild.typescript.typeCheckbuild.extendnuxt-edgebuild.publicPath.nuxt/dist/client.nuxt/distcss-loader~assets~/assetsvuex-router-syncts-loaderDeprecations to plan for
modescrollBehaviorapp/router.scrollBehavior.jsdevModulesbuildModulestransitionpageTransitionisClientisServerisStaticnuxt-tsssr: false plugin option in favor of a mode option of 'all', 'client' or 'server'; ssr still works until Nuxt 3.ssrmodestyleResources due to performance issues; use the community style-resources module instead.styleResourcesasyncData, fetch and middleware methods in favor of Promises or async/await.asyncDatafetchmiddlewarevendorAggressiveSplittingPluginrender.gziprender.compressor