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

提供基本模板,兼容npm模块。 #35

Closed
yyfrankyy opened this issue Jun 13, 2011 · 3 comments
Closed

提供基本模板,兼容npm模块。 #35

yyfrankyy opened this issue Jun 13, 2011 · 3 comments
Assignees
Labels

Comments

@yyfrankyy
Copy link
Contributor

基本模板依赖于package.json的起步信息,package.json 通过npm获取,然后根据基准模板,迁移npm模块。

define(function(require, exports, module) {/*{{code}}*/});
@ghost ghost assigned yyfrankyy Jun 13, 2011
@yyfrankyy
Copy link
Contributor Author

该功能类似ender里的"ender": "./ender.js" 不同的是,ender要求开发者事先打包好,而spm只要求提供自定义的wrapping template。

但是transport的时候就需要先从npm server安装,然后读取package.json 进而transport,再部署到spm的server端。

@yyfrankyy
Copy link
Contributor Author

拆分为几个子任务:

  1. 读取package.json里的spm,该配置声明tspt的位置,读取模板进而打包
  2. 直接调用npm的安装接口,install的时候先查spm服务,查不到,尝试查询npm,然后安装,安装完了递归打包。

比较麻烦的问题是,npm安装的模块大部分不止一个文件,批量transport之后,在web端其实可能会导致require乱序?

@lifesinger
Copy link

暂不考虑,npm 的大部分模块在 web 端无法简单通过 wrap 来实现通用化

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants