Parcel: 馃悰 Changing a Reason file other than the top level one does not trigger rebuild

Created on 17 Mar 2018  路  5Comments  路  Source: parcel-bundler/parcel

馃悰 bug report


Rebuild on file change doesn't work with Reason, except for the main file in the script tag.

馃帥 Configuration (.babelrc, package.json, cli command)


bsconfig.json

{
  "name": "example",
  "bs-dependencies": [],
  "bsc-flags": ["-bs-super-errors"],
  "package-specs": {
    "in-source": true,
    "module": "commonjs"
  },
  "reason": {
    "react-jsx": 2
  },
  "refmt": 3,
  "sources": {
    "dir": "src",
    "subdirs": true
  },
  "suffix": ".bs.js",
  "warnings": {
    "error": "+101"
  }
}

parcel --open public/index.html

馃 Expected Behavior

Changing any .re file that is used in the project triggers a rebuild.

馃槸 Current Behavior

Nothing happens when a .re file that is not directly included from the html is changed.

馃拋 Possible Solution

馃敠 Context

馃捇 Code Sample

https://github.com/aeons/parcel-example

Run yarn and yarn start.

Changing something in ./src/index.re triggers a rebuild and reload. Doing the same in ./src/OtherModule.redoes not.

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.6.2
| Node | 9.7.0
| npm/Yarn | yarn 1.5.1
| Operating System | macOS 10.13.3

CC @rrdelaney

Bug Stale

Most helpful comment

Oh man, there's actually a reason (heh) this happens. How Reason support works in Parcel is it basically requires the corresponding .bs.js file instead of the Reason file. The problem is all .bs.js files require other .bs.js files, not the .re files. This means the dependency graph looks like one .re file and a bunch of .bs.js files. We need a way to mark the .re files as contextual dependencies.

All 5 comments

Oh man, there's actually a reason (heh) this happens. How Reason support works in Parcel is it basically requires the corresponding .bs.js file instead of the Reason file. The problem is all .bs.js files require other .bs.js files, not the .re files. This means the dependency graph looks like one .re file and a bunch of .bs.js files. We need a way to mark the .re files as contextual dependencies.

One quick (and ugly ?) trick is to first launch bsb in watch mode (in an other terminal or in the background) and then start parcel:

(bsb -w &) && parcel index.html

Same issue here, it watches the entry point but not any other files :/

Does anyone have the time to make a reproduction of this and validate that it's still an issue with the latest release of parcel@next?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings