@graphcommerce/next-config 6.2.0-canary.77 → 6.2.0-canary.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/withGraphCommerce.js +3 -10
- package/package.json +1 -1
- package/src/withGraphCommerce.ts +3 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 6.2.0-canary.79
|
|
4
|
+
|
|
5
|
+
## 6.2.0-canary.78
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- [#1988](https://github.com/graphcommerce-org/graphcommerce/pull/1988) [`af8e0d176`](https://github.com/graphcommerce-org/graphcommerce/commit/af8e0d176af8197a0c13b9a29b438cb54cc29ce4) - Multi website with multiple duplicates locales support. Use `en-us-website1`, `en-us-website2` as the locale declaration. ([@hnsr](https://github.com/hnsr))
|
|
10
|
+
|
|
3
11
|
## 6.2.0-canary.77
|
|
4
12
|
|
|
5
13
|
## 6.2.0-canary.76
|
|
@@ -17,22 +17,14 @@ function domains(config) {
|
|
|
17
17
|
if (!loc.domain)
|
|
18
18
|
return acc;
|
|
19
19
|
acc[loc.domain] = {
|
|
20
|
-
defaultLocale: loc.
|
|
20
|
+
defaultLocale: loc.locale,
|
|
21
21
|
locales: [...(acc[loc.domain]?.locales ?? []), loc.locale],
|
|
22
22
|
domain: loc.domain,
|
|
23
|
-
http:
|
|
23
|
+
http: process.env.NODE_ENV === 'development' || undefined,
|
|
24
24
|
};
|
|
25
25
|
return acc;
|
|
26
26
|
}, {}));
|
|
27
27
|
}
|
|
28
|
-
function remotePatterns(url) {
|
|
29
|
-
const urlObj = new URL(url);
|
|
30
|
-
return {
|
|
31
|
-
hostname: urlObj.hostname,
|
|
32
|
-
protocol: urlObj.protocol,
|
|
33
|
-
port: urlObj.port,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
28
|
/**
|
|
37
29
|
* GraphCommerce configuration: .
|
|
38
30
|
*
|
|
@@ -58,6 +50,7 @@ function withGraphCommerce(nextConfig, cwd) {
|
|
|
58
50
|
swcPlugins: [...(nextConfig.experimental?.swcPlugins ?? []), ['@lingui/swc-plugin', {}]],
|
|
59
51
|
},
|
|
60
52
|
i18n: {
|
|
53
|
+
...nextConfig.i18n,
|
|
61
54
|
defaultLocale: storefront.find((locale) => locale.defaultLocale)?.locale ?? storefront[0].locale,
|
|
62
55
|
locales: storefront.map((locale) => locale.locale),
|
|
63
56
|
domains: [...domains(graphcommerceConfig), ...(nextConfig.i18n?.domains ?? [])],
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-config",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "6.2.0-canary.
|
|
5
|
+
"version": "6.2.0-canary.79",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "src/index.ts",
|
package/src/withGraphCommerce.ts
CHANGED
|
@@ -2,7 +2,6 @@ import CircularDependencyPlugin from 'circular-dependency-plugin'
|
|
|
2
2
|
import { DuplicatesPlugin } from 'inspectpack/plugin'
|
|
3
3
|
import type { NextConfig } from 'next'
|
|
4
4
|
import { DomainLocale } from 'next/dist/server/config'
|
|
5
|
-
import { RemotePattern } from 'next/dist/shared/lib/image-config'
|
|
6
5
|
import { DefinePlugin, Configuration } from 'webpack'
|
|
7
6
|
import { loadConfig } from './config/loadConfig'
|
|
8
7
|
import { configToImportMeta } from './config/utils/configToImportMeta'
|
|
@@ -18,10 +17,10 @@ function domains(config: GraphCommerceConfig): DomainLocale[] {
|
|
|
18
17
|
if (!loc.domain) return acc
|
|
19
18
|
|
|
20
19
|
acc[loc.domain] = {
|
|
21
|
-
defaultLocale: loc.
|
|
20
|
+
defaultLocale: loc.locale,
|
|
22
21
|
locales: [...(acc[loc.domain]?.locales ?? []), loc.locale],
|
|
23
22
|
domain: loc.domain,
|
|
24
|
-
http:
|
|
23
|
+
http: process.env.NODE_ENV === 'development' || undefined,
|
|
25
24
|
} as DomainLocale
|
|
26
25
|
|
|
27
26
|
return acc
|
|
@@ -29,15 +28,6 @@ function domains(config: GraphCommerceConfig): DomainLocale[] {
|
|
|
29
28
|
)
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
function remotePatterns(url: string): RemotePattern {
|
|
33
|
-
const urlObj = new URL(url)
|
|
34
|
-
return {
|
|
35
|
-
hostname: urlObj.hostname,
|
|
36
|
-
protocol: urlObj.protocol as RemotePattern['protocol'],
|
|
37
|
-
port: urlObj.port,
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
31
|
/**
|
|
42
32
|
* GraphCommerce configuration: .
|
|
43
33
|
*
|
|
@@ -66,6 +56,7 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
|
|
|
66
56
|
swcPlugins: [...(nextConfig.experimental?.swcPlugins ?? []), ['@lingui/swc-plugin', {}]],
|
|
67
57
|
},
|
|
68
58
|
i18n: {
|
|
59
|
+
...nextConfig.i18n,
|
|
69
60
|
defaultLocale:
|
|
70
61
|
storefront.find((locale) => locale.defaultLocale)?.locale ?? storefront[0].locale,
|
|
71
62
|
locales: storefront.map((locale) => locale.locale),
|