@@ -20,7 +20,24 @@ import * as path from 'path';
20
20
import { externs } from './externs.json' ;
21
21
import { renameInternals } from './scripts/rename-internals' ;
22
22
import { extractPublicIdentifiers } from './scripts/extract-api' ;
23
- import pkg from './package' ;
23
+
24
+ import pkg from './package.json' ;
25
+
26
+ export const browserDeps = Object . keys (
27
+ Object . assign ( { } , pkg . peerDependencies , pkg . dependencies )
28
+ ) ;
29
+
30
+ export const nodeDeps = [ ...browserDeps , 'util' , 'path' ] ;
31
+
32
+ /** Resolves the external dependencies for the browser build. */
33
+ export function resolveBrowserExterns ( id ) {
34
+ return browserDeps . some ( dep => id === dep || id . startsWith ( `${ dep } /` ) ) ;
35
+ }
36
+
37
+ /** Resolves the external dependencies for the Node build. */
38
+ export function resolveNodeExterns ( id ) {
39
+ return nodeDeps . some ( dep => id === dep || id . startsWith ( `${ dep } /` ) ) ;
40
+ }
24
41
25
42
const externsPaths = externs . map ( p => path . resolve ( __dirname , '../../' , p ) ) ;
26
43
const publicIdentifiers = extractPublicIdentifiers ( externsPaths ) ;
@@ -54,19 +71,3 @@ export const manglePrivatePropertiesOptions = {
54
71
}
55
72
}
56
73
} ;
57
-
58
- const browserDeps = Object . keys (
59
- Object . assign ( { } , pkg . peerDependencies , pkg . dependencies )
60
- ) ;
61
-
62
- const nodeDeps = [ ...browserDeps , 'util' , 'path' ] ;
63
-
64
- /** Resolves the external dependencies for the browser build. */
65
- export function resolveBrowserExterns ( id ) {
66
- return browserDeps . some ( dep => id === dep || id . startsWith ( `${ dep } /` ) ) ;
67
- }
68
-
69
- /** Resolves the external dependencies for the Node build. */
70
- export function resolveNodeExterns ( id ) {
71
- return nodeDeps . some ( dep => id === dep || id . startsWith ( `${ dep } /` ) ) ;
72
- }
0 commit comments