2017-02-04 47 views
1

工作。我有一个文件夹(应用程序),其中包含我所有的组件。在这个文件夹我有index.js我从文件夹中导出所有模块。在文件夹我有index.js文件导出组件本身。 例子:热模块更换不与我有一个问题,一些模块

app/test包含test.jsindex.js app/test/index.js包含export test from ./test.js app/index.js包含export * as test from ./test

而且某处在我的应用我导入此测试应用程序是这样import { test } from ../app

这里神奇在哪里出现。 hmr不适用于test.js。但是,如果我在app/index.js中注释行export * as test from ./test,并且我直接导入我的测试组件import test from ../app/test/test.js hmr。我一直试图修复它3天。 app/index.js被导入到我的routes.js文件中。这是它进口的唯一地方。只有app文件夹中的所有组件都不会热更新,除非它正常工作。我试图用任何样板复制它,但它没有成功。

在控制台中我看到

[WDS] App updated. Recompiling... 
log-apply-result.js?d762:11 [HMR] The following modules couldn't be hot updated: (They would  need a full reload!) 
log-apply-result.js?d762:18 [HMR] Nothing hot updated. 
only-dev-server.js?2f87:49 [HMR] App is up to date. 
client?e36c:37 [WDS] App updated. Recompiling... 
client?e36c:37 [WDS] Nothing changed. 

回答

0

的问题是使用文件夹结构。循环依赖失败。修复它固定的问题。