transmit-update-loader

0.2.0 • Public • Published

transmit-update-loader

CircleCI Build status npm version

Message passing tool to transmit an update to another file during webpack loader process.

Use case

Assume this file structure while using CSS Modules.

+- src/
    +- Button.tsx
    +- Button.css
    +- Button.css.d.ts

Here, also assume we use Webpack Hot Module Replacement for dev server.
When 'Button.css' is updated, 'Button.css.d.ts' could be updated.
Although, 'Button.tsx' will not be notified that 'Button.css.d.ts' is updated.
If 'Button.css' selector has changed, 'Button.tsx' won't be decorated correctly.

Fortunately, it seems that webpack detects update with watching the same event when it is touch-ed.

'Button.css' -(generate)-> 'Button.css.d.ts' -(watch)-(touch)-> 'Button.tsx' recompile.

TODO

  • Options
    • Throttle
    • [TBD]

Readme

Keywords

none

Package Sidebar

Install

npm i transmit-update-loader

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

17.9 kB

Total Files

18

Last publish

Collaborators

  • occar421