@graphcommerce/next-config 3.0.4 → 3.1.0

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`47a03c6c7`](https://github.com/graphcommerce-org/graphcommerce/commit/47a03c6c764cb1f544d3de3af52456608694a9d7) Thanks [@paales](https://github.com/paales)! - Files in node_modules/@graphcommerce will now also be watched and won’t be cached
8
+
9
+ ### Patch Changes
10
+
11
+ - [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`2e29c5852`](https://github.com/graphcommerce-org/graphcommerce/commit/2e29c585247d356e3027be92beb7815f2070c855) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
12
+
3
13
  ## 3.0.4
4
14
 
5
15
  ### Patch Changes
package/dist/index.js CHANGED
@@ -16,13 +16,25 @@ function extendConfig(nextConfig) {
16
16
  // Allow importing yml/yaml files for graphql-mesh
17
17
  config.module?.rules?.push({ test: /\.ya?ml$/, use: 'js-yaml-loader' });
18
18
  // To properly properly treeshake @apollo/client we need to define the __DEV__ property
19
- config.plugins = [new webpack_1.DefinePlugin({ __DEV__: options.dev }), ...(config.plugins ?? [])];
19
+ if (!options.isServer) {
20
+ config.plugins = [new webpack_1.DefinePlugin({ __DEV__: options.dev }), ...(config.plugins ?? [])];
21
+ }
20
22
  // @lingui .po file support
21
23
  config.module?.rules?.push({ test: /\.po/, use: '@lingui/loader' });
22
24
  config.experiments = {
23
25
  layers: true,
24
26
  topLevelAwait: true,
25
27
  };
28
+ config.snapshot = {
29
+ ...(config.snapshot ?? {}),
30
+ managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@graphcommerce)/],
31
+ };
32
+ // `config.watchOptions.ignored = ['**/.git/**', '**/node_modules/**', '**/.next/**']
33
+ // Replace the '**/node_modules/**' with a regex that excludes node_modules except @graphcommerce
34
+ config.watchOptions = {
35
+ ...(config.watchOptions ?? {}),
36
+ ignored: ['**/.git/**', '**/node_modules/!(@graphcommerce)**', '**/.next/**'],
37
+ };
26
38
  return typeof nextConfig.webpack === 'function' ? nextConfig.webpack(config, options) : config;
27
39
  },
28
40
  };
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": "3.0.4",
5
+ "version": "3.1.0",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "typings": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -39,7 +39,9 @@ function extendConfig(nextConfig: NextConfig): NextConfig {
39
39
  config.module?.rules?.push({ test: /\.ya?ml$/, use: 'js-yaml-loader' })
40
40
 
41
41
  // To properly properly treeshake @apollo/client we need to define the __DEV__ property
42
- config.plugins = [new DefinePlugin({ __DEV__: options.dev }), ...(config.plugins ?? [])]
42
+ if (!options.isServer) {
43
+ config.plugins = [new DefinePlugin({ __DEV__: options.dev }), ...(config.plugins ?? [])]
44
+ }
43
45
 
44
46
  // @lingui .po file support
45
47
  config.module?.rules?.push({ test: /\.po/, use: '@lingui/loader' })
@@ -49,6 +51,18 @@ function extendConfig(nextConfig: NextConfig): NextConfig {
49
51
  topLevelAwait: true,
50
52
  }
51
53
 
54
+ config.snapshot = {
55
+ ...(config.snapshot ?? {}),
56
+ managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@graphcommerce)/],
57
+ }
58
+
59
+ // `config.watchOptions.ignored = ['**/.git/**', '**/node_modules/**', '**/.next/**']
60
+ // Replace the '**/node_modules/**' with a regex that excludes node_modules except @graphcommerce
61
+ config.watchOptions = {
62
+ ...(config.watchOptions ?? {}),
63
+ ignored: ['**/.git/**', '**/node_modules/!(@graphcommerce)**', '**/.next/**'],
64
+ }
65
+
52
66
  return typeof nextConfig.webpack === 'function' ? nextConfig.webpack(config, options) : config
53
67
  },
54
68
  }