add eslint config and format build folder

This commit is contained in:
Clark Du 2017-03-27 11:47:57 +08:00
parent 39e7e56cf1
commit 1f9fbacfb8
6 changed files with 30 additions and 23 deletions

8
build/.eslintrc.json Normal file
View file

@ -0,0 +1,8 @@
{
"extends": [
"../.eslintrc.json"
],
"env": {
"node": true
}
}

View file

@ -1,7 +1,6 @@
/** /**
* 公共配置 * 公共配置
*/ */
var webpack = require('webpack');
var path = require('path'); var path = require('path');
function resolve (dir) { function resolve (dir) {
return path.join(__dirname, '..', dir) return path.join(__dirname, '..', dir)

View file

@ -6,9 +6,9 @@ var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
// var ExtractTextPlugin = require('extract-text-webpack-plugin'); // var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin'); var HtmlWebpackPlugin = require('html-webpack-plugin');
var merge = require('webpack-merge') var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js'); var webpackBaseConfig = require('./webpack.base.config.js');
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin') var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
module.exports = merge(webpackBaseConfig, { module.exports = merge(webpackBaseConfig, {

View file

@ -1,9 +1,9 @@
var path = require('path'); var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
var merge = require('webpack-merge') var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js'); var webpackBaseConfig = require('./webpack.base.config.js');
process.env.NODE_ENV = 'production' process.env.NODE_ENV = 'production';
module.exports = merge(webpackBaseConfig, { module.exports = merge(webpackBaseConfig, {
entry: { entry: {

View file

@ -1,6 +1,6 @@
var path = require('path'); var path = require('path');
var webpack = require('webpack'); var webpack = require('webpack');
var merge = require('webpack-merge') var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js'); var webpackBaseConfig = require('./webpack.base.config.js');
process.env.NODE_ENV = 'production'; process.env.NODE_ENV = 'production';

View file

@ -2,8 +2,8 @@
* 用于单元测试 * 用于单元测试
*/ */
var webpack = require('webpack') var webpack = require('webpack');
var merge = require('webpack-merge') var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js'); var webpackBaseConfig = require('./webpack.base.config.js');
@ -17,9 +17,9 @@ var webpackConfig = merge(webpackBaseConfig, {
} }
}) })
] ]
}) });
// no need for app entry during tests // no need for app entry during tests
delete webpackConfig.entry delete webpackConfig.entry;
module.exports = webpackConfig module.exports = webpackConfig;