Comments (4)
我们是这样子做的,每一个 app 都当作一个模块,然后用 https://github.com/spmjs/spm-build 来构建的。
spm-build 本质上来说就是内置了一套 Gruntfile 的配置,如果你的每个 app 的构建过程是一致的,可参考 spm-build。
from grunt-cmd-transport.
不明觉厉。
我建了个测试的目录结构如下:
├── app
│ └── cs
│ └── src
│ ├── index.js
│ └── waterflow.js
├── base
│ ├── libs
│ │ ├── seajs
│ │ │ ├── 1.1.0
│ │ │ │ ├── plugin-base.js
│ │ │ │ ├── plugin-coffee.js
│ │ │ │ ├── plugin-json.js
│ │ │ │ ├── plugin-less.js
│ │ │ │ ├── plugin-map.js
│ │ │ │ ├── plugin-text.js
│ │ │ │ ├── sea-debug.js
│ │ │ │ └── sea.js
│ │ │ └── 1.2.0
│ │ │ ├── plugin-base.js
│ │ │ ├── plugin-coffee.js
│ │ │ ├── plugin-json.js
│ │ │ ├── plugin-less.js
│ │ │ ├── plugin-map.js
│ │ │ ├── plugin-text.js
│ │ │ ├── sea-debug.js
│ │ │ └── sea.js
│ │ └── zepto
│ │ └── 1.0.0
│ │ ├── zepto-debug.js
│ │ └── zepto.js
│ ├── styles
│ │ └── component
│ │ └── slider
│ │ └── js
│ │ └── slider.js
│ └── utils
│ └── css3
│ └── css3.js
└── package.json
其中 index.js 依赖 zepto.js slider.js,slider.js 依赖 css3.js
package.json 如下:
{
"family": "M2UX",
"version": "1.2.0",
"name": "cs",
"description": "Mobile Projects: cs",
"spm": {
"source": "app",
"idleading": "mobile/cs/",
"output": ["index.js", "waterflow.js"],
"alias": {
"zepto": "base/libs/zepto/1.0.0/zepto.js"
},
"engines": {
"seajs": "base/libs/seajs/1.2.0/sea.js"
}
},
"private": true
}
环境:
spm: 2.1.2
node: v0.10.6
在 spm build 时,transport 找不到依赖:
Task: "transport:src" (transport) task
warn: can't find module base/libs/zepto/1.0.0/zepto.js
warn: can't find module base/libs/zepto/1.0.0/zepto.js
warn: can't find module base/libs/zepto/1.0.0/zepto.js
warn: can't find module base/libs/zepto/1.0.0/zepto.js
warn: can't find module base/libs/zepto/1.0.0/zepto.js
一定是我哪里写不对,麻烦指导一下,多谢。
项目在这里:[email protected]:huanglong/spm-out.git
from grunt-cmd-transport.
如果要用 spm-build,需要有严格的目录结构,依赖的必须放到 sea-modules 下,你可以
spm install zepto/zepto
from grunt-cmd-transport.
没有回复,先关了
from grunt-cmd-transport.
Related Issues (20)
- 文件名中出现 . 如a-2.0.js 出现依赖解析错误 HOT 1
- 未来版本支持自动加上define的功能么?
- js提取依赖支持vars定义的变量
- 最新版0.5.1依赖不能完全提取,降级到0.4.1可以全部提取。 HOT 6
- 最新版本在win8打包出来的路径有错误
- 打包时会自动转换 unicode,能否加个配置禁止这个转换。
- 提取依赖时jsParser::getFileInfo路径问题导致无法正常提取依赖
- Grunt升级到1.0.0后,transport无法使用
- 疑问
- 运行之后只提取了一个 require 依赖出来,请问这项目还有人维护吗 HOT 1
- 支持 hash
- seajs升级到2.3后 transport css的问题 HOT 2
- 当js模块的文件名含有"."时,无法将这个模块的依赖转化到依赖这个模块的依赖里? HOT 7
- 别名配置,支持替换require路径中的一个字段么? HOT 2
- 依赖只能匹配到第一个 HOT 5
- Arguments to path.join must be strings Use
- 依赖文件路径问题 HOT 3
- 最新版本(0.5.1)transport后路径出现双反斜杠 HOT 8
- 建议把jsParser里的filecache的作用域变为全局,可大幅提高效率 HOT 2
- 设置多个alias后,依赖的多个alias文件最后只剩一个
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 grunt-cmd-transport.