Skip to content

Commit

Permalink
Added doc for absolute import from gatsby eslint rules or other tools (
Browse files Browse the repository at this point in the history
…#22750)

* Added doc for absolute import from gatsby eslint rules or other tools

* Added doc for absolute import from gatsby eslint rules or other tools

* Prettier

* Prettier

* Added new section for importing non-webpack tools

* Update docs/docs/add-custom-webpack-config.md

Co-Authored-By: LB <laurie@gatsbyjs.com>

* Update docs/docs/add-custom-webpack-config.md

Co-Authored-By: LB <laurie@gatsbyjs.com>

* Update docs/docs/add-custom-webpack-config.md

Co-Authored-By: LB <laurie@gatsbyjs.com>

* Prettier run

* Undone other changes

Co-authored-by: LB <laurie@gatsbyjs.com>
  • Loading branch information
ashutosh1919 and LB authored Apr 10, 2020
1 parent 1bfd022 commit 5ca794d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/docs/add-custom-webpack-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ exports.onCreateWebpackConfig = ({ stage, actions }) => {

You can always find more information on _resolve_ and other options in the official [Webpack docs](https://webpack.js.org/concepts/).

### Importing non-webpack tools using `yarn`

Note that using absolute imports only applies to webpack resolutions and will not work for other tools, e.g. eslint or typescript.
But if you are using yarn, then the best practice is to set up your imports in package.json as shown below:

```js
{
"dependencies": {
"hooks": "link:./src/hooks",
}
}
```

### Modifying the Babel loader

You need this if you want to do things like transpile parts of `node_modules`.
Expand Down

0 comments on commit 5ca794d

Please sign in to comment.