Skip to content

Commit

Permalink
将 babel 配置移到 .babelrc 文件里
Browse files Browse the repository at this point in the history
  • Loading branch information
lmk123 committed Jun 14, 2016
1 parent 77f0e61 commit 4063a38
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
9 changes: 9 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"presets": [
"es2015",
"stage-3"
],
"plugins": [
"transform-runtime"
]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_js:
- "4"

before_install:
# 删除 node-sass 与 phantomjs 的镜像地址
# 删除镜像地址
- rm -f .npmrc
- npm install -g npm

Expand Down
2 changes: 1 addition & 1 deletion build/karma.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = function ( config ) {
options.reporters.push( 'coveralls' );
options.singleRun = true;
} else {
options.browsers = options.browsers.concat( [ 'Firefox' , 'Chrome' , 'IE' ] );
options.browsers = options.browsers.concat( [ 'Firefox' , 'Chrome' , 'IE' , 'Safari' ] );
}

config.set( options );
Expand Down
6 changes: 1 addition & 5 deletions build/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ module.exports = {
{
test : /\.js$/ ,
exclude : [ /node_modules(?!(\/|\\?\\)(translation\.js|selection-widget|connect\.io|chrome\-env)\1)/ ] ,
loader : 'babel-loader' ,
query : {
presets : [ 'es2015' , 'stage-3' ] ,
plugins : [ 'transform-runtime' ]
}
loader : 'babel-loader'
} ,
{
test : /\.woff$/ ,
Expand Down
7 changes: 0 additions & 7 deletions build/webpack.test.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ config.module.preLoaders = [
}
];

// 必须告诉 isparta 我使用了哪些 babel 设置,见 https://github.com/deepsweet/isparta-loader/issues/10
config.isparta = {
embedSource : true ,
noAutoWrap : true ,
babel : babelLoaderConfig.query
};

config.plugins.splice( 0 , 3 ); // 清空 webpack 优化
config.plugins.push( new webpack.DefinePlugin( { // 切换为测试环境
'process.env.NODE_ENV' : "'testing'"
Expand Down

0 comments on commit 4063a38

Please sign in to comment.