jamesandersen / string-replace-webpack-plugin

Replace string tokens in a bundle.
93 stars 27 forks source link

Cant use with 'babel-loader' #19

Open pociej opened 7 years ago

pociej commented 7 years ago

Im not sure if it issue with this plugin but when trying to use with 'babel-loader' line below :

loader : [
  { test: /myPattern/ , loader: 'babel-loader' }, 
  { test: /mySecondPattern/, loader: StringReplacePlugin({ settings }) },
] 

I see : Element from loaders list should have one of the fields 'loader' or 'loaders'

jamesandersen commented 7 years ago

@pociej I haven't run across that issue thus far. If you can pin it down to an issue in the plugin let me know (and a PR would be great!)

marcel-k commented 7 years ago

@pociej is it not supposed to be { test: /.../, loader: StringReplacePlugin.replace({ ... }) }, plugins: [ new StringReplacePlugin() ] } ?