【发布时间】:2015-04-23 16:52:33
【问题描述】:
尝试运行here 中提到的 facebook Flux 应用程序。我有以下 js 应用程序的树结构
│ .bundle.js
│ app.jsx
│ bundle.js
│
├───actions
│ TodoActions.jsx
│
├───components
│ Footer.jsx
│ Header.jsx
│ MainSection.jsx
│ TodoApp.jsx
│ TodoItem.jsx
│ TodoTextInput.jsx
│
├───constants
│ TodoConstants.jsx
│
├───dispatcher
│ AppDispatcher.jsx
│ Dispatcher.jsx
│
└───store
TodoStore.jsx
在 app.jsx 中的代码是这样的
var React = require('react');
var TodoApp = require('./components/TodoApp');
React.render(
<TodoApp />,
document.getElementById('todoapp')
);
在 TodoApp.jsx 中,我将模块导出为
module.exports = TodoApp;
当我尝试制作 build.js 时,它会出错
Error: Cannot find module './components/TodoApp' from 'c:\www\example\react\flux\js'
不知道我错在哪里?如果我需要对此提供任何进一步的信息,请告诉我
【问题讨论】: