oyslin / replace-in-file-webpack-plugin

A webpack plugin to quickly replace text in one or more files.
MIT License
34 stars 14 forks source link

TypeError: Cannot read property 'test' of undefined #3

Closed lencioni closed 6 years ago

lencioni commented 6 years ago

I tried setting up this plugin, but didn't specify a test or a files option, since they are documented as optional and I want it to run on every file. However, I get the following error:

/path/to/project/node_modules/replace-in-file-webpack-plugin/index.js:61
                                              return test.test(file);
                                                          ^

TypeError: Cannot read property 'test' of undefined

It looks like we probably need to have another branch in the conditional for this case.

oyslin commented 6 years ago

Fixed in version 1.0.6. Please install the latest version and test it.