watcher-webpack-plugin

1.1.2 • Public • Published

watcher-webpack-plugin

Webpack plugin to watch files with chokidar using glob. Runs webpack's subcompiler on file change if it is not already watched by webpack, runs callback on delete. This plugin is mainly used to enhance developer experience when generating typings on the fly when creating new files (*.module.css, *.graphql, ...) so you can use typings straight away when writing new TS files.


Example usage:
config.plugins = [
    ...
    new WatcherWebpackPlugin('src/**/*.(module.css|graphql)' ,{
        onRemove: (file) => Promise.all([
          unlinkIfExists(`${file}.d.ts`),
          unlinkIfExists(`${file}.types.ts`),
        ]),
    }),
];

Readme

Keywords

none

Package Sidebar

Install

npm i watcher-webpack-plugin

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

75.7 kB

Total Files

6

Last publish

Collaborators

  • pristas-peter