Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const chalk = require('chalk')
const semver = require('semver')
const webpack = require('webpack')

const COMMAND_OPTIONS = {
'-h, --host': 'specify server host',
Expand Down Expand Up @@ -29,13 +31,18 @@ module.exports = (api, options) => {
const { generateCacheIdentifier } = require('./utils')

api.chainWebpack(config => {
const rule = config.module
let rule = config.module
.rule('gql')
.test(/\.(gql|graphql)$/)
.use('cache-loader')
.loader('cache-loader')
.options({ cacheDirectory })
.end()

if (semver.major(webpack.version) !== 4) {
rule = rule
.use('cache-loader')
.loader('cache-loader')
.options({ cacheDirectory })
}

rule = rule.end()

if (useThreads) {
rule
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"graphql-tools": "^6.0.9",
"node-fetch": "^2.6.0",
"nodemon": "^2.0.4",
"semver": "^7.3.5",
"subscriptions-transport-ws": "^0.9.16",
"ts-node": "^8.10.2"
},
Expand Down