fis
fis copied to clipboard
fis实现多个项目node_modules共享
请问fis可不可以实现多个项目node_modules模块文件共享? 有没有这种配置或者hack方式,感谢!
你可以统一把这些资源放到一个 common 或者是 component 的项目下;然后在其他项目统一引入这个项目模块下的资源。
// @require 'common:node_modules/xxx/xxx/x.js'
- mac 在 ~/.bashrc 之类的加个别名命令 建立软连接
alias lnhere='ln -s <path/to/common/node_modules> node_modules'
- 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 - node
fs.symlinkSync('srcPath', 'destPath', 'dir')