next-compose-plugins
next-compose-plugins copied to clipboard
Webpack function in config is not called
I am trying to add "graphql-tag" to the webpack loaders, but the webapck function in the nextjs config is not being called.
Here's my next.config.js
:
const withPlugins = require('next-compose-plugins'),
withImages = require('next-images')
module.exports = withPlugins([withImages()], {
i18n: {
locales: ['en-US', 'hu'],
defaultLocale: 'hu'
},
webpack(config, options) {
config.module.rules.push({
test: /\.(graphql|gql)$/,
use: [
{
loader: require.resolve('graphql-tag/loader')
}
]
})
return config
}
})
The missing loader error is still being thrown:
error - ./queries/products.gql 1:6
Module parse failed: Unexpected token (1:6)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> query {
| allProducts {
| id
Why hasn't this been addressed? Makes this library nearly unusable.