Comments (11)
package.json 里没有 wrapping 信息
或者我们可以要求:package.json + transport.json ? transport 里仅包含 wrapping 信息。
from spm.
对,现在Wrapping规范,还就缺乏wrapping的模板定义。这个模板还真得依赖各种wrapping moduling的实现。
前面package.json部分,却大都是殊途同归。只不过在node方面考虑了更多的平台依赖,比如cpu架构,os信息,系统包依赖(比如openssl)
from spm.
wrapping 是 transport 的一种。
那我们就分拆成 package.json 和 transport.json 好了,呵呵。transport.json 里:
/**
* @package.json http://path/to/package.json
* @tags dom,event,library,ui library
*
* @src http://a.tbcdn.cn/s/kissy/1.2.0/kissy.js
* @min http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js
*/
define(function(require, exports, module) {
/*{{code}}*/
module.exports = KISSY;
});
from spm.
没有提供 package.json 的,本地建一个,同时 transport.json 里:
@package.json ./package.json
from spm.
packages里有这种配置,用来声明一些模块的本地路径,相当于我们的@src跟@min。
"directories": {
"lib": "src/lib",
"bin": "local/binaries",
"jars": "java"
}
如果指定本地目录,则从本地读取?
from spm.
我们给 package.json 增加一个?
"source code": {
"uncompressed": "http://...",
"minified": "http://..."
}
这样?
问题是,既有的 package.json 里,都无这些信息。对于没有的,还是得定一种格式,写在 transport.json 里。
from spm.
或者,去除 transport.json, 直接 package.json 里增加:
"transport": function() {
define(function(...) {
...
/{{code}}/
...
});
}
问题还是,这是我们定义的,麻烦。
from spm.
src跟min看来都是需要的,即对应已经build过的东西。
设想一个场景:jquery目前他的库里build目录是没有打包好的,即有一些库不会在源码库里保存他build好的文件,而transport.js 又需要他指定build好的src跟min,那他的transport.js 就没办法跟着自己的仓库一直维护着了。
怎么表示都还好,我的意思是,或者有些库可以不提供http/https,而是提供本地的路径?
from spm.
wrapping部分额外提供独立模板应该问题不大的,以后如果要对kissy做wrapping,只需要提供不同的模板就好了,同样requirejs好像也是有wrapping的成分在内,只要是wrapping都可以复用配置(即package.json),提供不同的wrapping模板。
from spm.
嗯,我明白了。
@src ./local/path/ 就好
是本地路径就抓本地的,呵呵。小心 win32:
C:\path\to...
根目录:/xx/tt/
还有相对路径
from spm.
直接port给了系统支持,不再做多余的地址解析操作。见下文。
https://github.com/seajs/spm/commit/551abd31644b4292c74c2728c3d3b2a9a3755c2d#diff-2
from spm.
Related Issues (20)
- 有没有计划babel升到6? HOT 2
- standlone 如何构建tpl,html 静态文件 HOT 2
- 搜组件名 http://spmjs.io/search?q=paging 搜索不到包 HOT 1
- 通过spm-sea 打包过后的路径不对 HOT 1
- 如何拷贝目录下的全部文件? HOT 1
- farewell spm, hello ant-tool HOT 9
- 安装spm报错 HOT 3
- spm3.7beta使用中总结遭遇的2个困惑 HOT 11
- 如何只打包特定目录下的所有js文件? HOT 1
- spm test && spm doc 执行时会将 global 配置应用到 test && example 文件 HOT 2
- spm server 打不开http://127.0.0.1:8000/ HOT 1
- spm doc的时候出错 HOT 2
- spm init没有工作 HOT 4
- 执行standalone命令出错 HOT 1
- Failed at the [email protected] install script 'node install.js'. HOT 4
- 好不容易装上了,但无论运行什么命令都报错
- spm上的jQuery无法下载安装,导致打包失败 HOT 1
- spm初始化没有src目录
- spmjs.io访问不了了 HOT 1
- spmjs.io域名到期了?仓库不能用了。。。 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spm.