aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Dapena Paz <jdapena@igalia.com>2022-04-28 11:48:26 +0200
committerJose Dapena Paz <jdapena@igalia.com>2022-05-03 18:45:01 +0200
commite91be225127ddea6be3ddae5cb35e88c2f0aafb8 (patch)
tree02e2e75e851ce14e9574b09603c376716ae36b43
parent7b796408f4ee1ca1b92a02445513d939079af46e (diff)
Update to more recent versions of webpack and other nodejs components. Bug-AGL: SPEC-4355 Signed-off-by: Jose Dapena Paz <jdapena@igalia.com> Change-Id: I9ef8c865b53922506bd106662d517618ce029290
-rw-r--r--package.json32
-rw-r--r--webpack.config.js72
2 files changed, 44 insertions, 60 deletions
diff --git a/package.json b/package.json
index 7856a88..2b2a10b 100644
--- a/package.json
+++ b/package.json
@@ -18,25 +18,23 @@
"automotivegradelinux"
],
"devDependencies": {
- "clean-webpack-plugin": "^1.0.1",
- "copy-webpack-plugin": "^4.6.0",
- "css-loader": "^2.1.0",
- "file-loader": "^4.0.0",
- "html-webpack-plugin": "^3.2.0",
- "image-webpack-loader": "^5.0.0",
- "mini-css-extract-plugin": "^0.5.0",
- "node-sass": "^4.12.0",
- "sass-loader": "^7.1.0",
- "style-loader": "^0.23.1",
- "uglifyjs-webpack-plugin": "^2.1.1",
- "webpack": "^4.29.5",
- "webpack-cli": "^3.2.3",
- "webpack-dev-server": "^3.7.2",
- "zip-webpack-plugin": "^3.0.0"
+ "clean-webpack-plugin": "^4.0.0",
+ "copy-webpack-plugin": "^10.2.4",
+ "css-loader": "^6.7.1",
+ "file-loader": "^6.2.0",
+ "html-webpack-plugin": "^5.5.0",
+ "mini-css-extract-plugin": "^2.6.0",
+ "node-sass": "^7.0.1",
+ "sass-loader": "^12.6.0",
+ "style-loader": "^3.3.1",
+ "uglify-js": "^3.15.4",
+ "webpack": "^5.72.0",
+ "webpack-cli": "^4.9.2",
+ "webpack-dev-server": "^4.8.1"
},
"dependencies": {
- "bootstrap": "4.4.1",
+ "bootstrap": "5.1.3",
"agl-js-api": "https://github.com/AGL-web-applications/agl-js-api.git#master",
- "mustache": "^3.1.0"
+ "mustache": "^4.2.0"
}
}
diff --git a/webpack.config.js b/webpack.config.js
index f92a414..bdd4bea 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,11 +1,9 @@
const path = require('path');
-const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
-const CleanWebpackPlugin = require('clean-webpack-plugin');
+const TerserPlugin = require('terser-webpack-plugin');
+const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const MiniCSSExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
-const ZipPlugin = require('zip-webpack-plugin');
-
module.exports = {
mode: 'production',
@@ -20,21 +18,30 @@ module.exports = {
library: '[name]'
},
optimization: {
- minimizer: [new UglifyJsPlugin()],
+ minimize: true,
+ minimizer: [
+ new TerserPlugin({
+ minify: TerserPlugin.uglifyJsMinify,
+ terserOptions: {}
+ })
+ ],
},
plugins: [
- new CleanWebpackPlugin(['dist']),
- new CopyPlugin([
- {
- from: 'src/appinfo.json',
- flatten: true
- },
- {
- from: 'src/images/*',
- to: 'images/',
- flatten: true
- },
- ]),
+ new CleanWebpackPlugin({
+ cleanAfterEveryBuildPatterns: ['dist']
+ }),
+ new CopyPlugin({
+ patterns: [
+ {
+ from: 'src/appinfo.json',
+ to: 'appinfo.json'
+ },
+ {
+ from: 'src/images/*',
+ to: 'images/[name][ext]'
+ },
+ ]
+ }),
new HtmlWebpackPlugin({
template: 'src/index.html',
filename: 'index.html',
@@ -42,13 +49,6 @@ module.exports = {
}),
new MiniCSSExtractPlugin({
filename: 'app.css',
- path: __dirname + '/dist'
- }),
- new ZipPlugin({
- path: __dirname + '/package',
- filename: 'background',
- extension: 'wgt',
- exclude: []
})
],
module: {
@@ -70,28 +70,14 @@ module.exports = {
},
{
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
- use: [
- {
- loader: 'file-loader',
- options: {
- name: '[name].[ext]',
- outputPath: 'fonts/'
- }
- }
- ]
+ type: 'asset/resource',
+ generator: {
+ filename: '[name][ext]'
+ }
},
{
test: /\.(gif|png|jpe?g|svg)$/i,
- use: [
- 'file-loader',
- {
- loader: "image-webpack-loader",
- options: {
- bypassOnDebug: true, // webpack@1.x
- disable: true, // webpack@2.x and newer
- },
- }
- ]
+ type: 'asset/resource'
}
]
},