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

add skip #856

Merged
merged 1 commit into from
Jun 26, 2014
Merged

add skip #856

merged 1 commit into from
Jun 26, 2014

Conversation

popomore
Copy link
Member

fix #854

sorrycc added a commit that referenced this pull request Jun 26, 2014
@sorrycc sorrycc merged commit 0e3a3a8 into master Jun 26, 2014
@popomore popomore deleted the option-skip branch June 26, 2014 03:38
@popomore popomore mentioned this pull request Jun 26, 2014
18 tasks
@afc163
Copy link
Member

afc163 commented Jul 18, 2014

skip 和 ignore 的区别是?

@sorrycc
Copy link
Member

sorrycc commented Jul 18, 2014

ignore 出现在依赖里,skip 不出现在依赖里。

@afc163
Copy link
Member

afc163 commented Jul 18, 2014

是否保留一个就好,无论是否出现在依赖里。

@sorrycc
Copy link
Member

sorrycc commented Jul 18, 2014

两个的功能有冲突,应用场景也不一样啊。

var _rng;
if (typeof require === 'function') {
try {
var _rb = require("crypto").randomBytes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加了 skip 之后,require("crypto") 仍在源码中,这样不会报错吗?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里假设 crypto 是 nodejs 端的逻辑,浏览器里运行时不会执行到。需求来自:#854

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明白,但这用例实际上会运行到。

Copy link
Member Author

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, 偏右 [email protected] wrote:

@@ -0,0 +1,13 @@
+define("a/1.0.0/index-debug", [], function(require, exports, module) {

Copy link
Member Author

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 [email protected]
wrote:

已经 try/catch 了—
Sent from Mailbox for iPhone
On Sat, Jul 19, 2014 at 12:56 AM, 偏右 [email protected] wrote:

@@ -0,0 +1,13 @@
+define("a/1.0.0/index-debug", [], function(require, exports, module) {

@afc163
Copy link
Member

afc163 commented Jul 18, 2014

skip 后的模块,不会出现在 define 的依赖数组中。

ignore 后的模块,则会出现。

这是区别?

@sorrycc
Copy link
Member

sorrycc commented Jul 18, 2014

从需求角度看,我理解是 skip 用于完全不需要的模块,ignore 用于需要但不希望打包进来的模块。

@afc163
Copy link
Member

afc163 commented Jul 18, 2014

目前 ignore 的模块必须要在 dependencis 中出现,比如 require('global-config'),必须要有 global-config 这个模块,还得给版本号。

看下这个问题:http://segmentfault.com/q/1010000000603236#a-1020000000610752

@afc163
Copy link
Member

afc163 commented Jul 18, 2014

skip 我理解了,只是现在的 ignore 是否使用条件太苛刻。

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

Successfully merging this pull request may close these issues.

spm build "not found but required" 的问题
3 participants