Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-on Nuxt.js Web Development

You're reading from   Hands-on Nuxt.js Web Development Build universal and static-generated Vue.js applications using Nuxt.js

Arrow left icon
Product type Paperback
Published in Aug 2020
Publisher Packt
ISBN-13 9781789952698
Length 698 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
LAU THIAM KOK LAU THIAM KOK
Author Profile Icon LAU THIAM KOK
LAU THIAM KOK
Lau Tiam Kok Kok Lau Lau Tiam Kok Kok Lau
Author Profile Icon Lau Tiam Kok Kok Lau
Lau Tiam Kok Kok Lau
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Preface 1. Section 1: Your First Nuxt App
2. Introducing Nuxt FREE CHAPTER 3. Getting Started with Nuxt 4. Adding UI Frameworks 5. Section 2: View, Routing, Components, Plugins, and Modules
6. Adding Views, Routes, and Transitions 7. Adding Vue Components 8. Writing Plugins and Modules 9. Adding Vue Forms 10. Section 3: Server-Side Development and Data Management
11. Adding a Server-Side Framework 12. Adding a Server-Side Database 13. Adding a Vuex Store 14. Section 4: Middleware and Security
15. Writing Route Middlewares and Server Middlewares 16. Creating User Logins and API Authentication 17. Section 5: Testing and Deployment
18. Writing End-to-End Tests 19. Using Linters, Formatters, and Deployment Commands 20. Section 6: The Further Fields
21. Creating an SPA with Nuxt 22. Creating a Framework-Agnostic PHP API for Nuxt 23. Creating a Real-Time App with Nuxt 24. Creating a Nuxt App with a CMS and GraphQL 25. Other Books You May Enjoy

From Vue to Nuxt

Nuxt is a higher-level Node.js web development framework for creating Vue apps that can be developed and deployed in two different modes: universal (SSR) or single-page application (SPA). Furthermore, you can deploy SSR and SPA in Nuxt as static-generated apps. Even though you can choose the SPA mode, the full power of Nuxt lies in its universal mode or server-side rendering (SSR) for building universal apps. A universal app is used to describe JavaScript code that can execute both on the client and the server-side. But if you wish to develop a classic (or standard/traditional) SPA, which executes on the client-side only, you may want to consider using vanilla Vue.

Note that an SPA mode Nuxt app is slightly different from a classic SPA. You will find out more about it later in this book and briefly in this chapter.

Nuxt is created on top of Vue, supercharged with some extra features such as asynchronous data, middleware, layouts, modules, and plugins that execute your app on the server-side first, and then on the client-side. This means the app generally renders quicker than the traditional server-side (or multiple-page) apps.

Nuxt is pre-installed with the following packages so that you don't have to install them, which you would do in a standard Vue app:

On top of that, Nuxt uses webpack and Babel to compile and bundle your code with the following webpack loaders:

In a nutshell, webpack is a module bundler that bundles all the scripts, styles, assets, and images in your JavaScript app, while Babel is a JavaScript compiler that compiles or transpiles the next-generation JavaScript (ES2015+) to browser-compatible JavaScript (ES5) so that you can run your code on current browsers.

For more information about webpack and Babel, please visit https://webpack.js.org/ and https://babeljs.io/, respectively.

webpack uses what they call loaders to preprocess your files when you import them via the JavaScript import statement or require method. You can write your loaders but you don't have to do so when compiling your code in Vue files since they have been created for you by the Babel community and Vue team. We'll discover the great features that come with Nuxt and those contributed by these loaders in the next section.

You have been reading a chapter from
Hands-on Nuxt.js Web Development
Published in: Aug 2020
Publisher: Packt
ISBN-13: 9781789952698
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image