diff options
author | Jose Dapena Paz <jdapena@igalia.com> | 2022-05-03 18:00:44 +0200 |
---|---|---|
committer | Jose Dapena Paz <jdapena@igalia.com> | 2022-05-03 18:44:44 +0200 |
commit | 1283e3bddd4655be0d5208fbbcd9535f8f1ff0f6 (patch) | |
tree | 5571df4fdb61024508d3a5ad86fe04432625432f /webpack.config.js | |
parent | cb6b66c3bd94a6ab18cad3ad87c827d4f7e623e9 (diff) |
Update dependencies.needlefish_13.93.0needlefish/13.93.013.93.0
Update to more recent NodeJS and webpack dependencies.
Bug-AGL: SPEC-4355
Signed-off-by: Jose Dapena Paz <jdapena@igalia.com>
Change-Id: I75a5fc0d69c104f1e4333abea0210030e4235a4c
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 103 |
1 files changed, 41 insertions, 62 deletions
diff --git a/webpack.config.js b/webpack.config.js index b4cbf0a..773cc7d 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', @@ -15,40 +13,42 @@ module.exports = { path: __dirname + '/dist' }, optimization: { - minimizer: [new UglifyJsPlugin()], + minimize: true, + minimizer: [ + new TerserPlugin({ + minify: TerserPlugin.uglifyJsMinify, + terserOptions: {} + }) + ], }, plugins: [ - new CleanWebpackPlugin(['dist']), - new CopyPlugin([ - { - from: 'src/icon.*', - flatten: true - }, - { - from: 'src/appinfo.json', - flatten: true - }, - { - from: 'src/mockups/*', - to: 'mockups/', - flatten: true - }, - { - from: 'src/images/*', - to: 'images/', - flatten: true - }, - { - from: 'src/images/icons/*', - to: 'images/icons/', - flatten: true - }, - { - from: 'src/templates/*', - to: 'templates/', - flatten: true - } - ]), + new CleanWebpackPlugin({ + cleanAfterEveryBuildPatterns: ['dist'] + }), + new CopyPlugin({ + patterns: [ + { + from: 'src/icon.*', + to: '[name][ext]' + }, + { + from: 'src/appinfo.json', + to: "appinfo.json" + }, + { + from: 'src/images/*', + to: 'images/[name][ext]' + }, + { + from: 'src/images/icons/*', + to: 'images/icons/[name][ext]' + }, + { + from: 'src/templates/*', + to: 'templates/[name][ext]' + } + ] + }), new HtmlWebpackPlugin({ template: 'src/index.html', filename: 'index.html', @@ -56,13 +56,6 @@ module.exports = { }), new MiniCSSExtractPlugin({ filename: 'app.css', - path: __dirname + '/dist' - }), - new ZipPlugin({ - path: __dirname + '/package', - filename: 'html5-launcher', - extension: 'wgt', - exclude: [] }) ], module: { @@ -84,28 +77,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: 'fonts/[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' } ] }, |