@dr.pogodin/react-utils 1.33.2 → 1.33.3

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.
@@ -4,9 +4,9 @@ import 'source-map-support/register';
4
4
  import http from 'http';
5
5
  import 'raf/polyfill';
6
6
  import { type Configuration } from 'webpack';
7
- import { type OptionsT as ServerOptionsT } from './server';
8
- export { getDefaultCspSettings, } from './server';
9
- export { errors } from './utils';
7
+ import { type OptionsT as ServerOptionsT, getDefaultCspSettings } from './server';
8
+ import { errors } from './utils';
9
+ export { errors, getDefaultCspSettings };
10
10
  type OptionsT = ServerOptionsT & {
11
11
  https?: {
12
12
  cert: string;
@@ -141,5 +141,7 @@ declare function launchServer(webpackConfig: Configuration, options: OptionsT):
141
141
  }>;
142
142
  declare namespace launchServer {
143
143
  var SCRIPT_LOCATIONS: typeof import("./renderer").SCRIPT_LOCATIONS;
144
+ var getDefaultCspSettings: typeof import("./server").getDefaultCspSettings;
145
+ var errors: typeof import("./utils/errors");
144
146
  }
145
147
  export default launchServer;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.33.2",
2
+ "version": "1.33.3",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"
@@ -17,14 +17,16 @@ import 'raf/polyfill';
17
17
 
18
18
  import { type Configuration } from 'webpack';
19
19
 
20
- import serverFactory, { type OptionsT as ServerOptionsT } from './server';
21
- import { SCRIPT_LOCATIONS, newDefaultLogger } from './renderer';
22
-
23
- export {
20
+ import serverFactory, {
21
+ type OptionsT as ServerOptionsT,
24
22
  getDefaultCspSettings,
25
23
  } from './server';
26
24
 
27
- export { errors } from './utils';
25
+ import { SCRIPT_LOCATIONS, newDefaultLogger } from './renderer';
26
+
27
+ import { errors } from './utils';
28
+
29
+ export { errors, getDefaultCspSettings };
28
30
 
29
31
  /**
30
32
  * Normalizes a port into a number, string, or false.
@@ -228,3 +230,5 @@ export default async function launchServer(webpackConfig: Configuration, options
228
230
  }
229
231
 
230
232
  launchServer.SCRIPT_LOCATIONS = SCRIPT_LOCATIONS;
233
+ launchServer.getDefaultCspSettings = getDefaultCspSettings;
234
+ launchServer.errors = errors;
@@ -23,8 +23,11 @@ export function requireWeak(
23
23
  if (!def) return named;
24
24
 
25
25
  Object.entries(named).forEach(([key, value]) => {
26
- if (def[key]) throw Error('Conflict between default and named exports');
27
- def[key] = value;
26
+ if (def[key]) {
27
+ if (def[key] !== value) {
28
+ throw Error('Conflict between default and named exports');
29
+ }
30
+ } else def[key] = value;
28
31
  });
29
32
  return def;
30
33
  } catch {