fis icon indicating copy to clipboard operation
fis copied to clipboard

fis实现多个项目node_modules共享

Open livisky opened this issue 9 years ago • 2 comments

请问fis可不可以实现多个项目node_modules模块文件共享? 有没有这种配置或者hack方式,感谢!

livisky avatar Jun 24 '15 13:06 livisky

你可以统一把这些资源放到一个 common 或者是 component 的项目下;然后在其他项目统一引入这个项目模块下的资源。

// @require 'common:node_modules/xxx/xxx/x.js'

oxUnd avatar Jun 26 '15 00:06 oxUnd

  1. mac 在 ~/.bashrc 之类的加个别名命令 建立软连接 alias lnhere='ln -s <path/to/common/node_modules> node_modules'
  2. win 让win像*nix 一样拥有别名命令 2.1 准备脚本,比如 auto.bat ,使用doskey 设置常用命令的别名 doskey lnhere=mklink /d .\node_modules <path/to/common/node_modules> 2.2 启动 cmd.exe时,自动执行批处理文件 注册表 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor 找到或新建键: 键名:AutoRun 键值:path/to/auto.bat
  3. node fs.symlinkSync('srcPath', 'destPath', 'dir')

twlk28 avatar Jun 30 '15 03:06 twlk28