From a50a2741ea0e677a74bf75de81bf8abc869241d7 Mon Sep 17 00:00:00 2001 From: Mix Date: Thu, 7 Jun 2018 09:59:10 -0300 Subject: [PATCH 1/2] added example with loader GraphQL --- docs/config/README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/config/README.md b/docs/config/README.md index 9422b0c2e3..80b4fed46c 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -168,6 +168,23 @@ module.exports = { } ``` +#### Modifying Loader with GraphQL example + +``` js +// vue.config.js +module.exports = { + chainWebpack: config => { + // GraphQL Loader + config.module + .rule('graphql') + .test(/\.graphql$/) + .use('graphql-tag/loader') + .loader('graphql-tag/loader') + .end() + } +} +``` + #### Replace existing Base Loader 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: From 893db294bf1b14bca7a8a00295608dc6c87cf420 Mon Sep 17 00:00:00 2001 From: Mix Date: Thu, 7 Jun 2018 10:38:12 -0300 Subject: [PATCH 2/2] title changed --- docs/config/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config/README.md b/docs/config/README.md index 80b4fed46c..129c0da6b6 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -168,7 +168,7 @@ module.exports = { } ``` -#### Modifying Loader with GraphQL example +#### Adding a new loader example ``` js // vue.config.js