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'); const gulp = require('gulp');
var cleanCSS = require('gulp-clean-css'); const cleanCSS = require('gulp-clean-css');
var less = require('gulp-less'); const less = require('gulp-less');
var rename = require('gulp-rename'); const rename = require('gulp-rename');
var autoprefixer = require('gulp-autoprefixer'); const autoprefixer = require('gulp-autoprefixer');
// 编译less // 编译less
gulp.task('css', function () { gulp.task('css', function () {

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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