@graphcommerce/next-config 3.0.4 → 3.1.2

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,27 @@
1
1
  # Change Log
2
2
 
3
+ ## 3.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1378](https://github.com/graphcommerce-org/graphcommerce/pull/1378) [`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5) Thanks [@paales](https://github.com/paales)! - Pin all versions internally so we can’t end up in an unfixable state for the user
8
+
9
+ ## 3.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#1369](https://github.com/graphcommerce-org/graphcommerce/pull/1369) [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies
14
+
15
+ ## 3.1.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [#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
20
+
21
+ ### Patch Changes
22
+
23
+ - [#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
24
+
3
25
  ## 3.0.4
4
26
 
5
27
  ### 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.2",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "typings": "dist/index.d.ts",
@@ -16,14 +16,14 @@
16
16
  "@lingui/loader": "^3.13.2",
17
17
  "js-yaml-loader": "^1.2.2",
18
18
  "next-transpile-modules": "^9.0.0",
19
- "type-fest": "^2.12.0",
20
19
  "webpack": "^5.70.0"
21
20
  },
22
21
  "devDependencies": {
23
- "typescript": "^4.6.2"
22
+ "typescript": "4.6.3",
23
+ "type-fest": "2.12.1"
24
24
  },
25
25
  "peerDependencies": {
26
- "next": "^12.0.10",
26
+ "next": "12.1.2",
27
27
  "webpack": "^5.70.0"
28
28
  },
29
29
  "files": [
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
  }