如何使用Webpack devServer监视父文件夹

问题描述

我使用webpack devServer在浏览器中热重载我的项目。因此,当我在contentBase之一中进行更新时,启用了watchContentBase选项以触发热重载:

  devServer: {
    contentBase: [path.join(__dirname,'public/'),path.join(__dirname,'src/data/')],watchContentBase: true,port: 9000
  }

因此,它在src/data/之类的子文件夹上运行良好,但是如果我尝试查看不在当前项目中的文件夹,则不会在任何更新时触发热重装:

  devServer: {
    contentBase: [
      path.join(__dirname,'src/data/'),'/../../other-project/public/') /* No hot reload when I make a change in this folder */
    ],compress: true,writetodisk: true,port: 9000
  }

作为某人有一个想法来查看外部文件夹(不在当前项目中)吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)