@@ -12,15 +12,15 @@ const tsConfig = require('../tsconfig.json');
1212const {
1313 transformLoadFileStaticallyFromNPM,
1414} = require ( './load-statically-from-npm' ) ;
15- const { rmdirRecursive, readdirRecursive, showStats } = require ( './utils' ) ;
15+ const { rmdirRecursive, readdirRecursive, showDirStats } = require ( './utils' ) ;
1616
1717if ( require . main === module ) {
18- rmdirRecursive ( './dist ' ) ;
19- fs . mkdirSync ( './dist ' ) ;
18+ rmdirRecursive ( './npmDist ' ) ;
19+ fs . mkdirSync ( './npmDist ' ) ;
2020
2121 const srcFiles = readdirRecursive ( './src' , { ignoreDir : / ^ _ _ .* _ _ $ / } ) ;
2222 const { options } = ts . convertCompilerOptionsFromJson (
23- tsConfig . compilerOptions ,
23+ { ... tsConfig . compilerOptions , outDir : 'npmDist' } ,
2424 process . cwd ( ) ,
2525 ) ;
2626 const program = ts . createProgram ( {
@@ -30,16 +30,19 @@ if (require.main === module) {
3030 program . emit ( undefined , undefined , undefined , undefined , {
3131 after : [ transformLoadFileStaticallyFromNPM ] ,
3232 } ) ;
33- downlevel ( './dist ' , './dist /ts3.4' ) ;
33+ downlevel ( './npmDist ' , './npmDist /ts3.4' ) ;
3434
35- fs . copyFileSync ( './LICENSE' , './dist /LICENSE' ) ;
36- fs . copyFileSync ( './README.md' , './dist /README.md' ) ;
35+ fs . copyFileSync ( './LICENSE' , './npmDist /LICENSE' ) ;
36+ fs . copyFileSync ( './README.md' , './npmDist /README.md' ) ;
3737
3838 // Should be done as the last step so only valid packages can be published
3939 const packageJSON = buildPackageJSON ( ) ;
40- fs . writeFileSync ( './dist/package.json' , JSON . stringify ( packageJSON , null , 2 ) ) ;
40+ fs . writeFileSync (
41+ './npmDist/package.json' ,
42+ JSON . stringify ( packageJSON , null , 2 ) ,
43+ ) ;
4144
42- showStats ( ) ;
45+ showDirStats ( './npmDist' ) ;
4346}
4447
4548function buildPackageJSON ( ) {
0 commit comments