-
Notifications
You must be signed in to change notification settings - Fork 10
/
next.config.js
45 lines (40 loc) · 873 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const path = require('path')
const { URL } = require('url')
module.exports = {
webpack: (config) => {
config.module.rules.push({
test: /\.(graphql|gql)$/,
loader: 'graphql-tag/loader',
})
config.resolve.alias = {
...config.resolve.alias,
'~': path.resolve(__dirname),
}
return config
},
async rewrites() {
return [
/**
* Rewrite /graphql requests to Magento
*/
{
source: '/graphql/:pathname*',
destination: new URL('graphql', process.env.MAGENTO_URL).href,
},
/**
* Sample of how to use APIs to Proxy Images
*/
{
source: '/store/:pathname*',
destination: '/api/proxy',
},
/**
* URlResolver 🙌
*/
{
source: '/:pathname*',
destination: '/_url-resolver',
},
]
},
}