Skip to content

Commit f87d918

Browse files
BlackMixyyx990803
authored andcommitted
docs: added example with loader GraphQL (#1501)
1 parent f46dc4c commit f87d918

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/config/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,23 @@ module.exports = {
168168
}
169169
```
170170

171+
#### Adding a new loader example
172+
173+
``` js
174+
// vue.config.js
175+
module.exports = {
176+
chainWebpack: config => {
177+
// GraphQL Loader
178+
config.module
179+
.rule('graphql')
180+
.test(/\.graphql$/)
181+
.use('graphql-tag/loader')
182+
.loader('graphql-tag/loader')
183+
.end()
184+
}
185+
}
186+
```
187+
171188
#### Replace existing Base Loader
172189

173190
If you want to replace an existing [Base Loader](https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js), for example using `vue-svg-loader` to inline SVG files instead of loading the file:

0 commit comments

Comments
 (0)