【发布时间】:2015-12-16 19:56:58
【问题描述】:
在此处遵循此要点 https://gist.github.com/ryanflorence/daafb1e3cb8ad740b346
我能够使用 Webpack 的“resolve.modulesDirectories”为一个非常复杂的应用程序设置一个很酷的文件夹结构 - 我可以通过模块类型导入来引用共享组件:
import MyModule from 'modules/MyModule';
文件在哪里
src/app/modules/Foo/modules/Bar/modules/Baz/component.jsx
MyModule 在
src/app/shared/modules/MyModule
问题是,当我尝试运行测试时
mocha --compilers js:babel-core/register $(find src/app -name *.test.jsx)
Babel 编译器抛出说它在 'modules/MyModule' 中找不到任何东西...
在 Babel 编译器配置中是否有类似 Webpack 的“modulesDirectories”?
【问题讨论】: