@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.
- package/build/development/server/index.js +2 -0
- package/build/development/server/index.js.map +1 -1
- package/build/development/shared/utils/webpack.js +5 -2
- package/build/development/shared/utils/webpack.js.map +1 -1
- package/build/development/web.bundle.js +1 -1
- package/build/production/server/index.js +1 -1
- package/build/production/server/index.js.map +1 -1
- package/build/production/shared/utils/webpack.js +1 -1
- package/build/production/shared/utils/webpack.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/server/index.d.ts +5 -3
- package/package.json +1 -1
- package/src/server/index.ts +9 -5
- package/src/shared/utils/webpack.ts +5 -2
|
@@ -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
|
-
|
|
9
|
-
export { errors }
|
|
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
package/src/server/index.ts
CHANGED
|
@@ -17,14 +17,16 @@ import 'raf/polyfill';
|
|
|
17
17
|
|
|
18
18
|
import { type Configuration } from 'webpack';
|
|
19
19
|
|
|
20
|
-
import serverFactory, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export {
|
|
20
|
+
import serverFactory, {
|
|
21
|
+
type OptionsT as ServerOptionsT,
|
|
24
22
|
getDefaultCspSettings,
|
|
25
23
|
} from './server';
|
|
26
24
|
|
|
27
|
-
|
|
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])
|
|
27
|
-
|
|
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 {
|