Use 'const' instead of 'var' in Webpack config

[MAILPOET-1667]
This commit is contained in:
Jan Jakeš
2019-01-09 14:38:10 +01:00
parent 38ef9a669e
commit 0801ba0463

View File

@ -1,14 +1,14 @@
var webpack = require('webpack'); const webpack = require('webpack');
var webpackManifestPlugin = require('webpack-manifest-plugin'); const webpackManifestPlugin = require('webpack-manifest-plugin');
var webpackCleanPlugin = require('clean-webpack-plugin'); const webpackCleanPlugin = require('clean-webpack-plugin');
var webpackTerserPlugin = require('terser-webpack-plugin'); const webpackTerserPlugin = require('terser-webpack-plugin');
var path = require('path'); const path = require('path');
var globalPrefix = 'MailPoetLib'; const globalPrefix = 'MailPoetLib';
var PRODUCTION_ENV = process.env.NODE_ENV === 'production'; const PRODUCTION_ENV = process.env.NODE_ENV === 'production';
var manifestSeed = {}; const manifestSeed = {};
// Base config // Base config
var baseConfig = { const baseConfig = {
mode: PRODUCTION_ENV ? 'production' : 'development', mode: PRODUCTION_ENV ? 'production' : 'development',
cache: true, cache: true,
context: __dirname, context: __dirname,
@ -232,7 +232,7 @@ var baseConfig = {
}; };
// Admin config // Admin config
var adminConfig = { const adminConfig = {
name: 'admin', name: 'admin',
entry: { entry: {
vendor: 'webpack_vendor_index.jsx', vendor: 'webpack_vendor_index.jsx',
@ -291,7 +291,7 @@ var adminConfig = {
}; };
// Public config // Public config
var publicConfig = { const publicConfig = {
name: 'public', name: 'public',
entry: { entry: {
public: 'webpack_public_index.jsx', public: 'webpack_public_index.jsx',
@ -311,7 +311,7 @@ var publicConfig = {
}; };
// Migrator config // Migrator config
var migratorConfig = { const migratorConfig = {
name: 'mp2migrator', name: 'mp2migrator',
entry: { entry: {
mp2migrator: [ mp2migrator: [
@ -325,7 +325,7 @@ var migratorConfig = {
}; };
// Test config // Test config
var testConfig = { const testConfig = {
name: 'test', name: 'test',
entry: { entry: {
vendor: 'webpack_vendor_index.jsx', vendor: 'webpack_vendor_index.jsx',