New reason-scripts release


New version should be compatible with bs-platform@3 and reason-react@0.4! Also some small updates to the bs-loader and read-bsconfig packages.


  • Replaced ReasonReact.stringToElement with ReasonReact.string
  • Updated bs-json to @glennsl/bs-json
  • Capitalized component file names
  • Turned on .bs.js suffix and in-source
  • Output ES modules instead of CJS


  • Better automatic detection of in-source builds


  • package-specs can now be either BsPackageSpec or BsPackageSpec[]


Thx for the great work !!!
I get a problem with npm test do you have a hint for me ?

ENOENT: no such file or directory, open '/folder/to/my/project/lib/js/src/App_test.js'


Turned on .bs.js suffix and in-source

fix that issue ?
Do i have to provide some flags to use that suffix ?

Thx in advance


That might be a bug on our side :confused: I’ll look at it to tonight, and let you know here :grin:


It looks a bit for me that I still have the old version but I checked and I installed 0.9.0 :thinking:
I will also try it again and let you know thx a lot for your help and sorry for the hustle.


Looked into this a bit, might be a problem with bs-loader’s Jest integration + in-source builds :confused: I don’t know how much time I have to fix it, but it should be soon :slight_smile:

The false provided as an argument here should be whether the build is in-source or not:


Had also a quick look and the latest version of createJestConfig.js would fix the problem.

There we have

testMatch: [ '<rootDir>/src/**/*test.{bs.js,js}' ]

I guess there is no reason to test both .re and ,bs.js files, but could you briefly explain why you prefer there to test the transpiled .bs.js files instead of the original .re file ?

Since we test the transpiled files i have to first call a bsb -make-world in order to have the testable files.
Also i cannot transpile to es6 and i have to use commonjs for package-specs.module otherwise i get another problem.

  â—Ź Test suite failed to run

    import * as List from "bs-platform/lib/es6/list.js";

    SyntaxError: Unexpected token import

      at ScriptTransformer._transformAndBuildScript (node_modules/jest-cli/node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
      at Object.<anonymous> (src/


That testMatch was definitely wrong, it shouldn’t be running the tests on .bs.js, it should be running them on the .re files and using bs-loader’s Jest integration.

I fixed bs-loader’s Jest integration last night in this commit but it still has problems with dependencies in node_modules being compiled as ES modules. I need to find a way to force Jest to compile things in node_modules with Babel to make the sources CommonJS compatible.