Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack does not watch for block.json changes #15135

Closed
Jackie6 opened this issue Apr 24, 2019 · 4 comments · Fixed by #15455
Closed

Webpack does not watch for block.json changes #15135

Jackie6 opened this issue Apr 24, 2019 · 4 comments · Fixed by #15455
Assignees
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling

Comments

@Jackie6
Copy link
Contributor

Jackie6 commented Apr 24, 2019

Describe the bug
Since #14770, the block.json is introduced. However, the webpack does not watch for the json files changes.

To reproduce
Steps to reproduce the behavior:

  1. npm run dev
  2. modify a block.json file
    The webpack does not rebuild the package automatically.

Desktop (please complete the following information):

  • OS: Mac OS
  • Browser: Chrome
  • Version: Gutenberg5.5
@swissspidy swissspidy added the [Type] Build Tooling Issues or PRs related to build tooling label Apr 24, 2019
@gziolo gziolo added the [Type] Bug An existing feature does not function as intended label Apr 24, 2019
@gziolo gziolo assigned gziolo and unassigned gziolo Apr 24, 2019
@gziolo gziolo added Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts labels Apr 24, 2019
@gziolo
Copy link
Member

gziolo commented Apr 24, 2019

Great catch @Jackie6 👍I totally missed it.

@aduth
Copy link
Member

aduth commented Apr 30, 2019

Implementation notes:

  • I would expect this should be working by default, since the implementation in Block library: Introduce block.json metadata for all client side blocks #14770 leverages Webpack's built-in JSON import capability. As with any other dependency, Webpack should be monitoring these dependencies for changes and triggering a rebuild automatically.
  • Alternatively, while JSON imports are available by default, perhaps it is an option to still specify a json-loader configuration if it is more reliable with triggering a rebuild (perhaps it's even enough to include the rules entry to test .json files, but specify no use loader)
  • If none of the above works, consider some third-party plugin which would provide the ability to hook into Webpack's internal watch mechanism to extend the files monitored to include block.json files (example).

@gziolo gziolo added [Status] In Progress Tracking issues with work in progress and removed Needs Dev Ready for, and needs developer efforts labels May 6, 2019
@gziolo gziolo self-assigned this May 6, 2019
@gziolo
Copy link
Member

gziolo commented May 6, 2019

I think the issue is only on Gutenberg side. We whitelist file patterns in packages to be watched for changes and we don't have json included there. I proposed a fix in #15455.

@talldan
Copy link
Contributor

talldan commented Jun 12, 2019

It seems like this issue wasn't completely solved. I've opened #16104. It is unusual that webpack doesn't pick up the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants