Webpack Watch回调

时间:2019-02-28 17:36:17

标签: webpack

如何在配置文件中添加webpack watch回调:

const watching = compiler.watch({
    /* watchOptions */
  }, (err, stats) => {
    // Print watch/build result here...
    console.log(stats.hash);
  });

在文档中,我发现了这一点:

import { Template } from '../template'; // No need for file extension but we're using a named export so we need the curly braces around 'Template'

export class MyComponent {
  @Prop() message: string;

  render() {
    return ( // You don't technically need the parentheses here as you're just returning one thing
      <Template /> // When outputting an imported component, it goes in angle brackets and the backslash closes it like an HTML element
    )
  }
}

但是我不知道如何添加它,谢谢

0 个答案:

没有答案