File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-console */
2
+
3
+ // DO NOT RUN this script yourself!
4
+ // This is invoked from the main `prepack.ts` script in `sentry-javascript/scripts/prepack.ts`.
5
+
6
+ import * as fs from 'fs' ;
7
+ import * as fse from 'fs-extra' ;
8
+ import * as path from 'path' ;
9
+
10
+ export function prepack ( buildDir : string ) : boolean {
11
+ // copy package-specific assets to build dir
12
+ const assetPath = path . resolve ( 'jsPolyfills' ) ;
13
+ const destinationPath = path . resolve ( buildDir , 'jsPolyfills' ) ;
14
+ try {
15
+ if ( ! fs . existsSync ( assetPath ) ) {
16
+ console . error (
17
+ "\nERROR: Missing 'packages/utils/jsPolyfills' directory. Please run `yarn build` in the `utils` package before running this script again." ,
18
+ ) ;
19
+ return false ;
20
+ }
21
+ console . log ( `Copying jsPolyfills to ${ path . relative ( '../..' , destinationPath ) } .` ) ;
22
+ fse . copySync ( assetPath , destinationPath ) ;
23
+ } catch ( error ) {
24
+ console . error ( `\nERROR: Error while copying jsPolyfills to ${ path . relative ( '../..' , destinationPath ) } :\n${ error } ` ) ;
25
+ return false ;
26
+ }
27
+ return true ;
28
+ }
You can’t perform that action at this time.
0 commit comments