There's a lot of configuration in
nuxt! But, it is much easier than configuring
webpackand other common tools. We will try to cover the most important parts here.
- 1.We configure
nuxtloader at build time inside
It is possible that you may miss
config/.envfile because it is ignored and excluded from
git. In this case, you will just need to copy
config/.env.templateand fill in all values that you need:
cp config/.env.template config/.env
Make sure that
config/.envis kept secret!
API_URLrepresent your API server base url. It is used as a base url for all relative urls we use to make
There are situations when you need to switch between different versions of your API: development or production, first version of your API or second version. The are multiple use-cases!
In this case, modify this single value inside your
Parts that you will need the most:
nuxtinstead of a regular
axiosbecause there are tons of goodies that are already included: retries, loading indicators, server-side proxy calls,
httpsenforcement, and so on.
Currently, we extend build with several rules:
- enable linting with
- settings handy alias for
- disabling crazy
cssclasses names during tests
Sometimes it is required to provide additional pages to prerender, or provide dynamic values to the dynamic pages.
Its configuration specifies which styles it should use. Pretty similar to
Rules defined there are just some hacks and fixes to make our development experience better.
It has a lot of options:
setupFilesis used to specify which files will be executed before all tests
moduleFileExtensionsspecifies which module we can safely import from
transformspecifies which parsers to use when importing different files
We also configure several tools inside
package.jsonitself. Here's a list of these tools.
This setting is very important. It specifies all the browsers that we use in our project.
It is required for multiple tools that are used in the project: