ExamplePlugin.js 280 B

1234567891011121314
  1. class ExamplePlugin {
  2. constructor(props) {
  3. this.props = props;
  4. }
  5. apply(compiler) {
  6. compiler.plugin("run", (compiler, callback) => {
  7. console.log("Webpack is running our plugin", this.props.msg);
  8. callback();
  9. });
  10. }
  11. }
  12. module.exports = ExamplePlugin;