Skip to content

Commit

Permalink
[fix] issue@17koa/koa2-demo#1
Browse files Browse the repository at this point in the history
  • Loading branch information
wssgcg1213 committed Apr 11, 2016
1 parent 3f7e908 commit dec4b8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

require("babel-polyfill")

var dir = __dirname + '/node_modules/'
// var dir = __dirname + '/node_modules/'
// set babel in entry file
require('babel-core/register')({
presets: [dir + 'babel-preset-es2015-node5', dir + 'babel-preset-stage-3'],
presets: ['babel-preset-es2015-node5', 'babel-preset-stage-3'],
babelrc: false
})

Expand Down

10 comments on commit dec4b8c

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

测试过npm2和npm3下都正常么?

@wssgcg1213
Copy link
Owner Author

Choose a reason for hiding this comment

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

npm3.8.5正常,稍等我测试一下2

你可以做个travis ci的集成,这样就方便了

@wssgcg1213
Copy link
Owner Author

Choose a reason for hiding this comment

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

果然 2有问题
先不急着 merge 吧
@i5ting

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

没空开travis ci,最近工作比较多,而且写书,快哭了 @wssgcg1213

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

这个可以这样做,https://github.com/i5ting/is_npm_v3 使用is_npm_v3,如果是v3,就采用你的那种做法,如果是v2按照我之前的做法做。一定要确定路径是runkoa模块下面的,不能使用相对路径,不然你在别的项目里用runkoa会有问题的 @wssgcg1213

@wssgcg1213
Copy link
Owner Author

Choose a reason for hiding this comment

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

把配置写在项目里而不是让用户自己配置.babelrc的方式是出于怎么样的考虑呢?

我发现没有加babel-plugin-add-module-exports这个插件,然后我又希望使用,那就只能改依赖的代码了

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

就是希望用户用的时候不要感知到babel,让这些只要专注写好koa相关代码就好了,其他的runkoa给你搞定就好了。加插件,其实可以在runkoa里实现的,安装这些插件到runkoa模块下,记录配置文件,然后require的时候自动加载

@wssgcg1213
Copy link
Owner Author

Choose a reason for hiding this comment

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

还是设计思想上的差异吧,上边说的那个插件求加上,不然 export default 出来的结果很蛋疼 😂

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

确实好蛋疼,我会在runkoa上提供这样的功能,我现在issue里面记下 , 17koa#3

@i5ting
Copy link

@i5ting i5ting commented on dec4b8c Apr 11, 2016

Choose a reason for hiding this comment

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

兄弟,你进一下你的注册github的邮箱,我邀请你进这个org了,一起来玩吧

Please sign in to comment.