Releases: nuxt/nuxt
Releases · nuxt/nuxt
v0.3.7
Features
- Remove the behaviour from the v0.3.6 for the static generation, now the page with a redirection is generated with an empty app telling nuxt that it has not been generated yet and to launch it from the client-side (the state for the store can be already filled)
- Change
redirect
api, it's now:redirect([code,] path [, query])
, the default status code is302
Found
export default {
data ({ redirect, route }) {
// Check if user is connected via req.session or JWT...
redirect('/login', { redirect: route.fullPath })
}
}
v0.3.6
Features
- Add
redirected
key in the result ofnuxt.renderRoute(route, context = {})
, useful for unit tests - Add
redirect
field in thecontext
received indata (context)
andfetch (context)
, useful for authenticated routes:
// Ex: dashboard.vue
<script>
export default {
fetch ({ redirect, route }) {
// Check if user is connected via req.session or JWT...
redirect({
path: '/login',
query: { redirect: route.fullPath }
})
}
}
</script>
You can also use redirect('/login')
if you don't want to add any query parameter.
The redirect also works for nuxt generate
and will create a html page with:
<meta http-equiv="refresh" content="0; url={{ redirectedPath }}" />
<script type="text/javascript">
window.location.href = '{{ redirectedPath }}'
</script>
v0.3.5
Feature
- Add
_build
and_renderer
options to control the start of the renderer and the build process when instantiatingNuxt(options)
Fix
- Dev server will render the correct routes when
router.base
is set - Fix webpack server config buildPath which was erased
- Stop using
path.join
to join url paths (on Windows, will be joined by a\
)
v0.3.4
Features
- Breaking changes: custom routes are now defined in
router.routes
, see examples/custom-routes/ - Add
router
object to cutomisevue-router
options:base
andlinkActiveClass
v0.3.3
v0.3.2
Features
- Thanks to @alexchopin for making
nuxt generate
to generate a static website with nuxt.js
v0.3.1
Features
- [dev mode] Nuxt.js is now watching on the pages/ folder to reload the build when a
.vue
file is added or removed (using chokidar) - Breaking changes: rename
nuxt.stop()
tonuxt.close()
to stop watching files on dev build (used by most libraries)
Misc.
- Add
use strict
in every js files of nuxt
v0.3.0
Features
- Breaking change:
./static/
folder is now mapped to/
, this to allows to haverobots.txt
files orsitemap.xml
, since there is no main reason to not map it to/
- Breaking change:
nuxt.renderRoute(route, context)
send back an object withhtml
anderror
instead of the html - Nuxt.js is now serving the
static
folder from itsrender(req, res)
function (instead of the server used by nuxt-dev and nuxt-start), this to keep consistency in the behaviour of nuxt
Misc
- Update
with-ava
example to check when the app sent back an error from the server - Update exit status to 1 when app fail to respect standard
v0.2.6
Features
nuxt build
-> Build only the applicationnuxt start
-> Launch the server and nuxt (without building it, so make sure to launch nuxt build before)- Add
dev
option to specify if the build will be for production or development, define also the webpack-dev-middleware and hot-reloading fornuxt-dev
Misc
- Refactoring some logic for webpack inside the webpack/*.config.js files
- Update README for production deployment
- Improve test with ava (checking the value of the color of the element)