@graphcommerce/next-config 8.1.0-canary.5 → 8.1.0-canary.50
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 +159 -0
- package/Config.graphqls +5 -5
- package/__tests__/config/utils/__snapshots__/mergeEnvIntoConfig.ts.snap +48 -2
- package/__tests__/config/utils/configToImportMeta.ts +0 -4
- package/__tests__/config/utils/mergeEnvIntoConfig.ts +15 -2
- package/__tests__/config/utils/rewriteLegancyEnv.ts +1 -1
- package/__tests__/interceptors/findPlugins.ts +144 -194
- package/__tests__/interceptors/generateInterceptors.ts +174 -91
- package/__tests__/interceptors/parseStructure.ts +50 -0
- package/__tests__/utils/resolveDependenciesSync.ts +4 -0
- package/dist/config/commands/exportConfig.js +5 -0
- package/dist/config/commands/generateConfig.js +5 -0
- package/dist/config/commands/generateIntercetors.js +9 -0
- package/dist/config/demoConfig.js +5 -0
- package/dist/config/utils/mergeEnvIntoConfig.js +8 -1
- package/dist/generated/config.js +17 -9
- package/dist/index.js +1 -0
- package/dist/interceptors/commands/codegenInterceptors.js +23 -0
- package/dist/interceptors/commands/generateIntercetors.js +9 -0
- package/dist/interceptors/extractExports.js +21 -18
- package/dist/interceptors/findOriginalSource.js +17 -1
- package/dist/interceptors/findPlugins.js +7 -3
- package/dist/interceptors/generateInterceptor.js +32 -15
- package/dist/interceptors/generateInterceptors.js +6 -5
- package/dist/interceptors/parseStructure.js +9 -1
- package/dist/interceptors/writeInterceptors.js +7 -7
- package/dist/utils/resolveDependenciesSync.js +5 -4
- package/dist/utils/resolveDependency.js +5 -0
- package/dist/withGraphCommerce.js +14 -5
- package/package.json +1 -1
- package/src/config/commands/exportConfig.ts +3 -0
- package/src/config/commands/generateConfig.ts +3 -0
- package/src/config/demoConfig.ts +5 -0
- package/src/config/utils/mergeEnvIntoConfig.ts +9 -1
- package/src/generated/config.ts +57 -19
- package/src/index.ts +1 -0
- package/src/interceptors/commands/codegenInterceptors.ts +27 -0
- package/src/interceptors/extractExports.ts +21 -21
- package/src/interceptors/findOriginalSource.ts +16 -1
- package/src/interceptors/findPlugins.ts +7 -3
- package/src/interceptors/generateInterceptor.ts +39 -15
- package/src/interceptors/generateInterceptors.ts +9 -6
- package/src/interceptors/parseStructure.ts +14 -1
- package/src/interceptors/writeInterceptors.ts +7 -7
- package/src/utils/resolveDependenciesSync.ts +11 -3
- package/src/utils/resolveDependency.ts +7 -0
- package/src/withGraphCommerce.ts +15 -6
package/src/withGraphCommerce.ts
CHANGED
|
@@ -112,8 +112,19 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
|
|
|
112
112
|
},
|
|
113
113
|
transpilePackages,
|
|
114
114
|
webpack: (config: Configuration, options) => {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
if (!config.module) config.module = { rules: [] }
|
|
116
|
+
|
|
117
|
+
config.module = {
|
|
118
|
+
...config.module,
|
|
119
|
+
rules: [
|
|
120
|
+
...(config.module.rules ?? []),
|
|
121
|
+
// Allow importing yml/yaml files for graphql-mesh
|
|
122
|
+
{ test: /\.ya?ml$/, use: 'js-yaml-loader' },
|
|
123
|
+
// @lingui .po file support
|
|
124
|
+
{ test: /\.po/, use: '@lingui/loader' },
|
|
125
|
+
],
|
|
126
|
+
exprContextCritical: false,
|
|
127
|
+
}
|
|
117
128
|
|
|
118
129
|
if (!config.plugins) config.plugins = []
|
|
119
130
|
|
|
@@ -121,8 +132,9 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
|
|
|
121
132
|
config.plugins.push(new DefinePlugin(importMetaPaths))
|
|
122
133
|
|
|
123
134
|
// To properly properly treeshake @apollo/client we need to define the __DEV__ property
|
|
135
|
+
config.plugins.push(new DefinePlugin({ 'globalThis.__DEV__': options.dev }))
|
|
136
|
+
|
|
124
137
|
if (!options.isServer) {
|
|
125
|
-
config.plugins.push(new DefinePlugin({ __DEV__: options.dev }))
|
|
126
138
|
if (graphcommerceConfig.debug?.webpackCircularDependencyPlugin) {
|
|
127
139
|
config.plugins.push(
|
|
128
140
|
new CircularDependencyPlugin({
|
|
@@ -147,9 +159,6 @@ export function withGraphCommerce(nextConfig: NextConfig, cwd: string): NextConf
|
|
|
147
159
|
}
|
|
148
160
|
}
|
|
149
161
|
|
|
150
|
-
// @lingui .po file support
|
|
151
|
-
config.module?.rules?.push({ test: /\.po/, use: '@lingui/loader' })
|
|
152
|
-
|
|
153
162
|
config.snapshot = {
|
|
154
163
|
...(config.snapshot ?? {}),
|
|
155
164
|
managedPaths: [
|