@@ -44,14 +44,16 @@ var nativePath = path.join(__dirname, "..", "native", "4.06.1", "bin");
44
44
var OCAMLC = path . join ( nativePath , "ocamlc.opt" ) ;
45
45
var OCAMLRUN = path . join ( nativePath , "ocamlrun" ) ;
46
46
var JSOO = path . join ( __dirname , ".." , "vendor" , "js_of_ocaml.bc" ) ;
47
- function prepare ( ) {
48
- console . log ( "building byte code version of the compiler" ) ;
47
+ function prepare ( isDev ) {
48
+ var [ env , ocamlFlag , jsooFlag ] = isDev
49
+ ? [ "development" , "-g " , "--pretty " ]
50
+ : [ "production" , "" , "" ] ;
51
+ console . log ( `building byte code version of the compiler [${ env } ]` ) ;
49
52
e (
50
- `${ OCAMLC } -w -30-40 -no-check-prims -I ${ jsRefmtCompDir } ${ jsRefmtCompDir } /js_refmt_compiler.mli ${ jsRefmtCompDir } /js_refmt_compiler.ml -o jsc.byte `
53
+ `${ OCAMLC } ${ ocamlFlag } -w -30-40 -no-check-prims -I ${ jsRefmtCompDir } ${ jsRefmtCompDir } /js_refmt_compiler.mli ${ jsRefmtCompDir } /js_refmt_compiler.ml -o jsc.byte `
51
54
) ;
52
55
console . log ( "building js version" ) ;
53
- e ( `${ OCAMLRUN } ${ JSOO } compile jsc.byte -o exports.js` ) ;
54
- // e() js_of_ocaml jsc.byte -o exports.js
56
+ e ( `${ OCAMLRUN } ${ JSOO } compile jsc.byte ${ jsooFlag } -o exports.js` ) ;
55
57
console . log ( "copy js artifacts" ) ;
56
58
e ( `cp ../lib/js/*.js ${ playground } /stdlib` ) ;
57
59
e ( `mv ./exports.js ${ playground } ` ) ;
@@ -83,7 +85,7 @@ function prepublish() {
83
85
} ) ;
84
86
}
85
87
86
- prepare ( ) ;
88
+ prepare ( process . argv . includes ( "-development" ) ) ;
87
89
if ( process . argv . includes ( "-prepublish" ) ) {
88
90
prepublish ( ) ;
89
91
}
0 commit comments