@nixxie-cms/core 1.0.1 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nixxie-cms/core",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/nixxiecms/nixxie/tree/main/packages/core"
@@ -302,7 +302,7 @@
302
302
  "@types/react-dom": "^19.2.3",
303
303
  "@types/resolve": "^1.20.2",
304
304
  "@types/uuid": "^11.0.0",
305
- "@nixxie-cms/core": "^1.0.1"
305
+ "@nixxie-cms/core": "^1.0.2"
306
306
  },
307
307
  "preconstruct": {
308
308
  "entrypoints": [
@@ -154,6 +154,35 @@ const nextConfigTemplate = basePath => `const nextConfig = {
154
154
  // as they import ts files into nextjs
155
155
  transpilePackages: ['../../admin'],
156
156
  ${basePath ? `basePath: '${basePath}',` : ''}
157
+ webpack: (config, { webpack, isServer }) => {
158
+ // The Admin UI bundle pulls in isomorphic helpers (e.g. the GraphQL schema builder) from
159
+ // server packages whose modules also import Node built-ins via the "node:" scheme. Webpack
160
+ // cannot resolve "node:"-scheme imports for the browser, so on the client we strip the prefix
161
+ // and stub the built-ins to empty modules. The server-only code paths that actually use them
162
+ // are never executed in the browser.
163
+ if (!isServer) {
164
+ config.plugins.push(
165
+ new webpack.NormalModuleReplacementPlugin(/^node:/, resource => {
166
+ resource.request = resource.request.replace(/^node:/, '')
167
+ })
168
+ )
169
+ config.resolve.fallback = {
170
+ ...config.resolve.fallback,
171
+ crypto: false,
172
+ fs: false,
173
+ 'fs/promises': false,
174
+ http: false,
175
+ https: false,
176
+ module: false,
177
+ net: false,
178
+ os: false,
179
+ path: false,
180
+ stream: false,
181
+ util: false,
182
+ }
183
+ }
184
+ return config
185
+ },
157
186
  }
158
187
 
159
188
  module.exports = nextConfig`;
@@ -133,6 +133,35 @@ const nextConfigTemplate = basePath => `const nextConfig = {
133
133
  // as they import ts files into nextjs
134
134
  transpilePackages: ['../../admin'],
135
135
  ${basePath ? `basePath: '${basePath}',` : ''}
136
+ webpack: (config, { webpack, isServer }) => {
137
+ // The Admin UI bundle pulls in isomorphic helpers (e.g. the GraphQL schema builder) from
138
+ // server packages whose modules also import Node built-ins via the "node:" scheme. Webpack
139
+ // cannot resolve "node:"-scheme imports for the browser, so on the client we strip the prefix
140
+ // and stub the built-ins to empty modules. The server-only code paths that actually use them
141
+ // are never executed in the browser.
142
+ if (!isServer) {
143
+ config.plugins.push(
144
+ new webpack.NormalModuleReplacementPlugin(/^node:/, resource => {
145
+ resource.request = resource.request.replace(/^node:/, '')
146
+ })
147
+ )
148
+ config.resolve.fallback = {
149
+ ...config.resolve.fallback,
150
+ crypto: false,
151
+ fs: false,
152
+ 'fs/promises': false,
153
+ http: false,
154
+ https: false,
155
+ module: false,
156
+ net: false,
157
+ os: false,
158
+ path: false,
159
+ stream: false,
160
+ util: false,
161
+ }
162
+ }
163
+ return config
164
+ },
136
165
  }
137
166
 
138
167
  module.exports = nextConfig`;
@@ -11,6 +11,35 @@ export const nextConfigTemplate = (basePath?: string) =>
11
11
  // as they import ts files into nextjs
12
12
  transpilePackages: ['../../admin'],
13
13
  ${basePath ? `basePath: '${basePath}',` : ''}
14
+ webpack: (config, { webpack, isServer }) => {
15
+ // The Admin UI bundle pulls in isomorphic helpers (e.g. the GraphQL schema builder) from
16
+ // server packages whose modules also import Node built-ins via the "node:" scheme. Webpack
17
+ // cannot resolve "node:"-scheme imports for the browser, so on the client we strip the prefix
18
+ // and stub the built-ins to empty modules. The server-only code paths that actually use them
19
+ // are never executed in the browser.
20
+ if (!isServer) {
21
+ config.plugins.push(
22
+ new webpack.NormalModuleReplacementPlugin(/^node:/, resource => {
23
+ resource.request = resource.request.replace(/^node:/, '')
24
+ })
25
+ )
26
+ config.resolve.fallback = {
27
+ ...config.resolve.fallback,
28
+ crypto: false,
29
+ fs: false,
30
+ 'fs/promises': false,
31
+ http: false,
32
+ https: false,
33
+ module: false,
34
+ net: false,
35
+ os: false,
36
+ path: false,
37
+ stream: false,
38
+ util: false,
39
+ }
40
+ }
41
+ return config
42
+ },
14
43
  }
15
44
 
16
45
  module.exports = nextConfig`