-
Notifications
You must be signed in to change notification settings - Fork 179
Conversation
skip 和 ignore 的区别是? |
ignore 出现在依赖里,skip 不出现在依赖里。 |
是否保留一个就好,无论是否出现在依赖里。 |
两个的功能有冲突,应用场景也不一样啊。 |
var _rng; | ||
if (typeof require === 'function') { | ||
try { | ||
var _rb = require("crypto").randomBytes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了 skip 之后,require("crypto")
仍在源码中,这样不会报错吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里假设 crypto 是 nodejs 端的逻辑,浏览器里运行时不会执行到。需求来自:#854
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
明白,但这用例实际上会运行到。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经 try/catch 了—
Sent from Mailbox for iPhone
On Sat, Jul 19, 2014 at 12:56 AM, 偏右 notifications@github.com wrote:
@@ -0,0 +1,13 @@
+define("a/1.0.0/index-debug", [], function(require, exports, module) {
- (function() {
- var _rng;
- if (typeof require === 'function') {
try {
var _rb = require("crypto").randomBytes;
明白,但这用例实际上会运行到。
Reply to this email directly or view it on GitHub:
https://github.com/spmjs/spm/pull/856/files#r15121400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑把 ignore 改成 noTransport 是不是更好理解—
Sent from Mailbox for iPhone
On Sat, Jul 19, 2014 at 10:49 AM, haoliang gao sakura9515@gmail.com
wrote:
已经 try/catch 了—
Sent from Mailbox for iPhone
On Sat, Jul 19, 2014 at 12:56 AM, 偏右 notifications@github.com wrote:@@ -0,0 +1,13 @@
+define("a/1.0.0/index-debug", [], function(require, exports, module) {
- (function() {
- var _rng;
- if (typeof require === 'function') {
try {
var _rb = require("crypto").randomBytes;
明白,但这用例实际上会运行到。
Reply to this email directly or view it on GitHub:
https://github.com/spmjs/spm/pull/856/files#r15121400
skip 后的模块,不会出现在 define 的依赖数组中。 ignore 后的模块,则会出现。 这是区别? |
从需求角度看,我理解是 skip 用于完全不需要的模块,ignore 用于需要但不希望打包进来的模块。 |
目前 ignore 的模块必须要在 dependencis 中出现,比如 require('global-config'),必须要有 global-config 这个模块,还得给版本号。 看下这个问题:http://segmentfault.com/q/1010000000603236#a-1020000000610752 |
skip 我理解了,只是现在的 ignore 是否使用条件太苛刻。 |
fix #854