File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 99 "test" : " jest --watch" ,
1010 "test:ci" : " NODE_ENV=production jest --silent" ,
1111 "start" : " cross-env NODE_ENV=development webpack-dev-server --host 0.0.0.0 --port 8000 --config ./examples/typescript/webpack.config.js --history-api-fallback --content-base examples/typescript" ,
12- "build" : " npm run clean && tsc && tsc -m es6 --outDir lib-esm && cross-env NODE_ENV=production webpack" ,
12+ "build" : " npm run clean && tsc && tsc -m es6 --outDir lib-esm && cross-env NODE_ENV=production webpack && npm run fixmaps" ,
13+ "fixmaps" : " node scripts/modify_sourcemap_paths.js" ,
1314 "clean" : " shx rm -rf _bundles lib lib-esm build" ,
1415 "docs" : " ./scripts/docs.js" ,
1516 "package" : " npm run build" ,
5859 "conventional-changelog-cli" : " 1.1.1" ,
5960 "cross-env" : " ^4.0.0" ,
6061 "enzyme" : " ^2.8.2" ,
61- "glob" : " ^7.0.5 " ,
62+ "glob" : " ^7.1.2 " ,
6263 "jest" : " ^20.0.3" ,
6364 "prettier" : " ^1.5.2" ,
6465 "prop-types" : " ^15.5.10" ,
Original file line number Diff line number Diff line change 1+ #!env node
2+ "use strict" ;
3+
4+ require ( 'shelljs/global' ) ;
5+ const fs = require ( 'fs' ) ;
6+ const path = require ( 'path' ) ;
7+ const glob = require ( 'glob' ) ;
8+ const pkgName = require ( '../package.json' ) . name ;
9+ const prefix = path . resolve ( __dirname , '..' ) ;
10+
11+ const allartifacts = require ( './artifacts.json' ) . ARTIFACTS ;
12+ const globs = allartifacts
13+ . map ( dir => path . resolve ( prefix , dir ) )
14+ . filter ( dir => fs . lstatSync ( dir ) . isDirectory ( ) )
15+ . map ( dir => `${ dir } /**/*.js.map` ) ;
16+
17+ const files = globs
18+ . map ( pattern => glob . sync ( pattern ) )
19+ . reduce ( ( acc , arr ) => acc . concat ( arr ) , [ ] ) ;
20+
21+ files . forEach ( file => {
22+ const data = JSON . parse ( fs . readFileSync ( file ) ) ;
23+ if ( Array . isArray ( data . sources ) ) {
24+ data . sources = data . sources . map ( source => source . replace ( / ^ (?: \. \. \/ ) * s r c / , pkgName ) ) ;
25+ fs . writeFileSync ( file , JSON . stringify ( data ) ) ;
26+ }
27+ } ) ;
You can’t perform that action at this time.
0 commit comments