webpack: remove eslint, added terser optimization in prod build

This commit is contained in:
Bachir Soussi Chiadmi 2020-11-25 15:25:57 +01:00
parent c12f72e3fe
commit f002c81008
7 changed files with 3624 additions and 2326 deletions

View File

@ -1,8 +0,0 @@
core/**/*
vendor/**/*
sites/**/files/**/*
libraries/**/*
sites/**/libraries/**/*
profiles/**/libraries/**/*
**/js_test_files/**/*
**/node_modules/**/*

View File

@ -1,29 +0,0 @@
module.exports =
root: true,
parserOptions: {
parser: 'babel-eslint'
},
env: {
browser: true,
node: true,
mocha: true
},
globals: {
"expect": true,
"jQuery": false
},
extends: [
'./web/core/.eslintrc.json',
'plugin:vue/recommended',
'plugin:vue-a11y/base',
'standard'
],
plugins: [
'vue',
'vue-a11y'
],
rules: {
'generator-star-spacing': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
}

View File

@ -1,7 +1,7 @@
'use strict'
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const { VueLoaderPlugin } = require('vue-loader')
const ESLintPlugin = require('eslint-webpack-plugin');
const utils = require('./utils')
@ -25,16 +25,16 @@ module.exports = {
},
module: {
rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
exclude: /node_modules/,
options: {
emitError: true,
emitWarning: true
}
},
// {
// test: /\.(js|vue)$/,
// loader: 'eslint-loader',
// enforce: 'pre',
// exclude: /node_modules/,
// options: {
// emitError: true,
// emitWarning: true
// }
// },
{
test: /\.vue$/,
use: 'vue-loader'
@ -82,5 +82,6 @@ module.exports = {
filename: '[name].css'
}),
new VueLoaderPlugin()
// new ESLintPlugin()
]
}

View File

@ -7,7 +7,6 @@ const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = merge(baseConfig, {
mode: 'development',
module: {
rules: [
{

View File

@ -4,35 +4,10 @@ const webpack = require('webpack')
const merge = require('webpack-merge')
const baseConfig = require('./webpack.config.base')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const TerserPlugin = require("terser-webpack-plugin");
module.exports = merge(baseConfig, {
mode: 'production',
optimization: {
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
// Eliminate comments
comments: false,
// remove warnings
warnings: false,
compress: {
// Drop console statements
drop_console: true,
}
}
})
]
// splitChunks: {
// cacheGroups: {
// commons: {
// test: /[\\/]node_modules[\\/]/,
// name: "vendor",
// chunks: "all",
// },
// },
// },
},
module: {
rules: [
{
@ -61,9 +36,22 @@ module.exports = merge(baseConfig, {
}
]
},
plugins: [
// new MiniCssExtractPlugin({
// filename: 'main.css'
// })
]
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
sourceMap: true, // Must be set to true if using source-maps in production
parallel: true,
test: /\.(js|vue)$/,
// extractComments: true
terserOptions: {
compress: {
drop_console: true,
},
},
})
],
},
// ,
// plugins: []
})

5785
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -19,53 +19,51 @@
"license": "MIT",
"dependencies": {
"axios": "^0.18.1",
"vue": "^2.6.10",
"vue": "^2.6.12",
"vue-autofocus-directive": "^1.0.4",
"vue-cool-lightbox": "^1.0.11",
"vue-infinite-loading": "^2.4.4",
"vue-cool-lightbox": "^1.1.0",
"vue-infinite-loading": "^2.4.5",
"vue-meta": "^1.6.0",
"vue-router": "^3.1.3",
"vue-router": "^3.4.9",
"vue-vimeo-player": "^0.1.0",
"vue-youtube-embed": "^2.2.2",
"vuex": "^3.1.1"
"vuex": "^3.5.1"
},
"devDependencies": {
"@babel/core": "^7.7.0",
"@babel/preset-env": "^7.7.1",
"@vue/test-utils": "^1.0.0-beta.29",
"@babel/core": "^7.12.9",
"@babel/preset-env": "^7.12.7",
"@vue/test-utils": "^1.1.1",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^10.0.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^24.9.0",
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "^5.0.4",
"babel-loader": "^8.2.1",
"copy-webpack-plugin": "^5.1.2",
"css-loader": "^2.1.1",
"eslint": "^5.15.3",
"eslint-config-airbnb": "^18.2.0",
"eslint-config-prettier": "^6.15.0",
"eslint-config-standard": "^12.0.0",
"eslint-loader": "^2.2.1",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-standard": "^4.1.0",
"eslint-plugin-vue": "^5.2.3",
"eslint-plugin-vue-a11y": "0.0.28",
"eslint-webpack-plugin": "^2.4.0",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.13.0",
"node-sass": "^4.14.1",
"sass-loader": "^7.3.1",
"style-loader": "^0.23.1",
"uglify-es": "^3.3.9",
"uglifyjs-webpack-plugin": "^2.2.0",
"url-loader": "^1.1.2",
"vue-jest": "^3.0.5",
"vue-loader": "^15.7.2",
"vue-server-renderer": "^2.6.10",
"vue-jest": "^3.0.7",
"vue-loader": "^15.9.5",
"vue-server-renderer": "^2.6.12",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.10",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.44.2",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2"
}
}