myCustom和ToDo分别是react app,想把MyCustom导入ToDo app里面作为一个模块,所以我的试用文件夹结构如下。
[api]
|
[client]
|- [MyCustom]
|- [ToDo]
| |- [src] (in src, will use - import {} from 'myCustom')
| |- tsconfig.json (added "paths": { "myCustom": ["../myCustom/src"] })
| |- package.json (added dependency - "myCustom": "1.0.0")
[client] npm install
它说 myCustom
不在npm注册表中。你能指出这里有什么问题吗?
在TODO webpack.config.js文件中,我添加了以下内容。
resolve: {
modules: ['../MyCustom/src']
},
resolveLoader: {
modules: ['../MyCustom/src', 'myCustom']
}
并构建失败,出现以下错误。 未找到模块。错误,无法解析'source-map-loader'。无法解析'source-map-loader'。
我是不是用错了加载器?