Skip to content
This repository has been archived by the owner on Aug 15, 2018. It is now read-only.

spm 2, 3 共存方案

偏右 edited this page Jun 5, 2014 · 17 revisions

背景

由于 2 和 3 将会共存一段时间,而直接通过 $ npm install spm@ninja 安装 3 会覆盖原来的 2,所以这里提供一个方案,在不影响 2 使用的基础上安装 3 。

安装脚本

git clone https://github.com/spmjs/spm ~/.spm3
cd ~/.spm3
cnpm install
ln -sf `pwd`/bin/spm /usr/local/bin/spm3

至此,spm -V 应该是 2,spm3 -V 应该是 3 。

插件使用

原有的其他插件和子命令可以保持原来的用法。比如 init:

  • 在 spm2 模块中使用。

    $ spm init
    
  • 在 spm3 模块中使用。

    $ spm3 init
    

另外两个兼容的插件 status 和 deploy

结论是 spm-status 不再升级,去掉。

spm-deploy 的 1.x 版本只对 spm3 项目进行兼容,需要安装旧版 spm deploy 的就运行 npm install [email protected] -g。不再提供共存方案。

后续内部用户对 dist 文件部署的需求,推荐使用浩初的 alipay-static 来进行。