In this topic, we are going to break down the custom modules we've created into small pieces – snippets.
You can find all the following code in /chapter-6/nuxt-universal/module-snippets/ in our GitHub repository.
Using top-level options
Remember the configuration options that we said can be passed into a module in the Writing a basic module section? Module options are top-level options for registering our modules in the Nuxt config file. We can even combine multiple options from the different modules and their options can be shared. Let's try an example of using @nuxtjs/axios and @nuxtjs/proxy together in the following steps:
- Install these two modules together using npm:
$ npm i @nuxtjs/axios
$ npm i @nuxtjs/proxy
These two modules are well integrated to prevent CORS problems, which we will see and discuss later in this book when developing cross-domain apps. It is not required to manually register the @nuxtjs/proxy module, but it does need...