@nuxt/server
2.18.1 · 28 Jun 2024MIT163.2k / weekRepositoryHomepagenpmAtom feed
2.18.1 is the newest release of 2.x.
In short
2 deprecated14 new4 faster30 fixed2 changed44 internal
- Deprecated
ts: Deprecate
isClient,isServer,isStatic - Deprecated
ts: Add warning for nuxt-ts deprecation
Release note
15,000 line changes with 230 squashed commits by more than 30 contributors made this version possible! :heart:
What's new?
Typescript DX
No longer needed to install nuxt-ts for typescript support. Nuxt.js officially supports TS by installing @nuxt/typescript. Please see #5079 for reasons behind such migration.
Babel
Babel 7.4, Core-js v3, and Object.assign polyfill for better browser support.
Stability
More than 30 fixes, refactors and performance improvements.
Open in Browser
Use nuxt dev -o to instantly open project in the browser and enjoy a cool loading screen:
nuxt-loading-screen
.nuxtignore
Before v2.5, you were able to ignore files through an ignore prefix. As using the prefix over and over, ignoring files (and implementing custom structures) was a bit tedious on the long run. We came up with something more sophisticated: A .nuxtignore file. Following the same specs as a .eslintignore or a .gitignore file, you can now define what files or folders to ignore through a .nuxtignore file in your project root.
Examples and more info in the .nuxtignore docs
[IMPORTANT] Migration Guide
Lock Files
For a clean upgrade, please remove yarn.lock / package-lock.json file from your project before upgrade.
Programmatic API / Middleware
If not already done, please explicitly call nuxt.ready() after new Nuxt(). nuxt.ready() was always async, but not awaiting the function call has now a severe impact.
const nuxt = new Nuxt(config) ++ await nuxt.ready()
TypeScript
Please replace
nuxt-tsdependency and usenuxt+@nuxt/typescript. (Alsonuxt-ts-edgetonuxt-edge+@nuxt/typescript-edgefor edge users)
{
-- "nuxt-ts": "^2.4.2"
++ "@nuxt/typescript": "^2.5.0"
++ "nuxt": "^2.5.0"
}Configuration API to customize/disable type checking has been moved from
build.useForkTsCheckertobuild.typescript.typeCheck. Please see #5079 for more details.
build: {
-- useForkTsChecker: false // or ForkTsChecker options
++ typescript : {
++ typeCheck: false // or ForkTsChecker options
++ }
}Features
babel: Include
es6.object.assignby default (Clark Du)cli: Lock project during build or generate
cli: Option to open the project in the browser
generate: Return non-zero code or page error (fixes #4991)
module: Support src as a function in addModule
Support
.nuxtignore(#4647) (Xin Du (Clark))Support
devModulesoptionts: Nuxt configuration typedefs
vue-app: Universal fetch
vue-renderer: Improvements
vue-renderer: Use async fs
ts: Better DX for typescript support
Loading screen (#5251) (Sébastien Chopin, Pooya Parsa)
Support core-js 3 (#5291) (Xin Du (Clark))
Fixes
builder, vue-app: Order of plugin execution based on order in array
Correct public path in generation and start (#5202) (Xin Du (Clark))
Default for-exit to false to prevent dev exit (pooya parsa)
Disable "analyze" for nuxt generate
Disable parallel build when extractCSS is enabled (Clark Du)
Extra properties in templateFiles (#4925) (Xin Du (Clark))
Fix non standard esm modifications (pooya parsa)
Generate failure
keep-alive component data should not be updated (#5188) (Xin Du (Clark))
Not send Server-Timing header if no timing info (Clark Du)
postcss: Default to preset-env and cssnano last
publicPath is not reactive in dev restarting (#5227) (Xin Du (Clark))
Refactor file watchers (chokidar/linux workaround)
Remove cache-loader for external resources (#4915) (Xin Du (Clark))
Respect namespaced in store module (#5189) (Xin Du (Clark))
Revert templatFiles name (#4924) (Xin Du (Clark))
Trailing comma in tsconfig
- Deprecated
ts: Deprecate
isClient,isServer,isStatic types: Reflect chainlable NuxtLoading methods
Unexpected token .... Expected a property name in Safari (Clark Du)
vua-app: Clone mount error to prevent mutating read-only error object
vue-app: Avoid css chunk error
webpack: Clone
config.entry(fixes #4849)Disable extract-css-chunks-webpack-plugin in dev mode (#4888) (Xin Du (Clark))
server: Handle decodeURI error
Correct socket address in use error message (Clark Du)
utils: Relax lock settings
vue-app: Multiple named views cause invalid syntax
webpack: Loaders in extend config is broken (#5292) (Xin Du (Clark))
vue-app: Duplicated router.base when using context.redirect(object)
vue-app: Decode router base to support unicode characters
Performance Improvements
Await routeData promises in parallel
core: Skip esm for node_modules and non .js files
webpack: Use
futureEmitAssetsts: transpileOnly when using
nuxt-ts start
Refactors
- Deprecated
ts: Add warning for nuxt-ts deprecation
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.