@@ -206,5 +206,31 @@ Now instead of requiring `@babel/register`, require `test/_register` instead.
Note that loading `@babel/register` in every worker process has a non-trivial performance cost. If you have lots of test files, you may want to consider using a build step to compile your sources *before* running your tests. This isn't ideal, since it complicates using AVA's watch mode, so we recommend using `@babel/register` until the performance penalty becomes too great. Setting up a precompilation step is out of scope for this document, but we recommend you check out one of the many [build systems that support Babel](http://babeljs.io/docs/setup/). There is an [issue](https://github.com/avajs/ava/issues/577) discussing ways we could make this experience better.
[Webpack aliases](https://webpack.js.org/configuration/resolve/#resolve-alias) can be used to provide a shortcut to deeply nested or otherwise inconvenient paths. If you already use aliases in your source files, you'll need to make sure you can use the same aliases in your test files.
Install `babel-plugin-webpack-alias-7` as a dev-dependency. Then add the plugin to AVA's Babel config:
-`npm i --save-dev require-extension-hooks require-extension-hooks-vue require-extension-hooks-babel`
-`npm i --save-dev require-extension-hooks require-extension-hooks-vue require-extension-hooks-babel@beta`
-`npm i --save-dev browser-env`
- Optional: [babel-plugin-webpack-alias-7](https://github.com/shortminds/babel-plugin-webpack-alias-7) if you want to use [webpack aliases](https://webpack.js.org/configuration/resolve/#resolve-alias) or use them in your source files
-`npm i --save-dev babel-plugin-webpack-alias-7`
The first step is setting up a helper to configure the environment to transpile `.vue` files and run in a browser like environment.