【问题标题】:Visual Studio npm scoped modules development?Visual Studio npm 范围模块开发?
【发布时间】:2016-07-27 04:34:30
【问题描述】:

我在 nodejs/typescript/visual studio 开发方面经验很少,可以使用一些建议和指导。

我正在开始一个新的 vs2015 解决方案来开发几个 nodejs 范围的模块。 我的问题是:

  1. 我应该如何构建我的项目文件夹?
  2. 是否有我应该使用的特定工具链或工作流程?

到目前为止,这是我一起破解的:

该项目似乎编译和运行良好,但有不少问题:

  • 当@product/core 发生变化时,@product/analysis 没有发现它
    • 打字稿错误:找不到成员
    • npm 安装/更新不起作用
  • 必须手动删除 node_modules 后跟“npm install”
    • 删除/重新安装 node_modules 时遇到 typescript 编译器错误
    • 但是 Resharper 无法拾取它,除非我卸载/重新加载项目

【问题讨论】:

    标签: node.js typescript visual-studio-2015


    【解决方案1】:

    必须手动删除 node_modules 后跟“npm install”

    这是要走的路。我觉得这些 IDE 应该支持 sync,就像 atom-typescript 一样:https://github.com/TypeStrong/atom-typescript#sync,alm 也是如此:https://basarat.gitbooks.io/alm/content/features/typescript.html#sync

    可悲的是,VS 的同步版本目前是重新启动/fs 更改足够大。

    【讨论】:

    • 感谢您的回复。我想我可能可以编写一个 gulp 任务来自动删除 node_modules 文件夹并重新安装。关于构建项目目录的任何想法?还有,使用“file:....”来引用本地模块?谢谢
    • Any thoughts on structuring the project directories? 从根文件夹中的所有内容开始,然后看看您的项目如何迫使您自然地将内容移动到文件夹中
    猜你喜欢
    • 1970-01-01
    • 2018-01-21
    • 2014-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多