eslint and replace "var" with "const"

This commit is contained in:
Sergio Crisostomo 2017-09-29 09:45:50 +02:00
parent 0a0971da1d
commit 4a7f28fd64
8 changed files with 39 additions and 39 deletions

View file

@ -1,8 +1,8 @@
var gulp = require('gulp');
var cleanCSS = require('gulp-clean-css');
var less = require('gulp-less');
var rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer');
const gulp = require('gulp');
const cleanCSS = require('gulp-clean-css');
const less = require('gulp-less');
const rename = require('gulp-rename');
const autoprefixer = require('gulp-autoprefixer');
// 编译less
gulp.task('css', function () {

View file

@ -1,8 +1,8 @@
const readDir = require('fs').readdirSync
const files = readDir('./src/locale/lang')
const entry = {}
const readDir = require('fs').readdirSync;
const files = readDir('./src/locale/lang');
const entry = {};
files.forEach(file => {
const name = file.split('.')[0]
entry[name] = './src/locale/lang/' + file
})
module.exports = entry
const name = file.split('.')[0];
entry[name] = './src/locale/lang/' + file;
});
module.exports = entry;

View file

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

View file

@ -2,13 +2,13 @@
* 本地预览
*/
var path = require('path');
var webpack = require('webpack');
// var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js');
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
// const ExtractTextPlugin = require('extract-text-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const merge = require('webpack-merge');
const webpackBaseConfig = require('./webpack.base.config.js');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
module.exports = merge(webpackBaseConfig, {

View file

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

View file

@ -1,6 +1,6 @@
var path = require('path');
var webpack = require('webpack');
var entry = require('./locale');
const path = require('path');
const webpack = require('webpack');
const entry = require('./locale');
process.env.NODE_ENV = 'production';
module.exports = {
@ -12,7 +12,7 @@ module.exports = {
loader: 'babel-loader',
exclude: /node_modules/
}
],
]
},
output: {
path: path.resolve(__dirname, '../dist/locale'),
@ -29,4 +29,4 @@ module.exports = {
}
})
]
}
};

View file

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

View file

@ -2,12 +2,12 @@
* 用于单元测试
*/
var webpack = require('webpack');
var merge = require('webpack-merge');
var webpackBaseConfig = require('./webpack.base.config.js');
const webpack = require('webpack');
const merge = require('webpack-merge');
const webpackBaseConfig = require('./webpack.base.config.js');
var webpackConfig = merge(webpackBaseConfig, {
const webpackConfig = merge(webpackBaseConfig, {
// use inline sourcemap for karma-sourcemap-loader
devtool: '#inline-source-map',
plugins: [