diff options
author | Jose Dapena Paz <jdapena@igalia.com> | 2022-05-03 18:02:45 +0200 |
---|---|---|
committer | Jose Dapena Paz <jdapena@igalia.com> | 2022-05-03 18:44:24 +0200 |
commit | 6abbe876aee09b225af9329e28b4fa2cc4d4c220 (patch) | |
tree | 7f661ec1433d5bb7762a14ac25492cb1ac4bc1b2 /webpack.config.js | |
parent | e64d69bdad0bb302900ec631b54ad6b6d6dcbacd (diff) |
Update to recent dependencies.needlefish_13.93.0needlefish/13.93.013.93.0
Update to recent versions of webpack and other nodejs
dependencies.
Bug-AGL: SPEC-4355
Signed-off-by: Jose Dapena Paz <jdapena@igalia.com>
Change-Id: I1740be13a4b0b3e6b5832e58a805f1fa8374236b
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 74 |
1 files changed, 30 insertions, 44 deletions
diff --git a/webpack.config.js b/webpack.config.js index b300f01..9c87768 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', @@ -24,30 +22,34 @@ 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/icon.*', - flatten: true - }, - { - from: 'src/appinfo.json', - flatten: true - }, - { - from: 'src/mockups/*', - to: 'mockups/', - flatten: true - }, - { - from: 'src/images/*', - to: 'images/', - 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]' + } + ] + }), new HtmlWebpackPlugin({ template: 'src/index.html', filename: 'index.html', @@ -55,13 +57,6 @@ module.exports = { }), new MiniCSSExtractPlugin({ filename: 'app.css', - path: __dirname + '/dist' - }), - new ZipPlugin({ - path: __dirname + '/package', - filename: 'hvac', - extension: 'wgt', - exclude: [] }) ], module: { @@ -83,16 +78,7 @@ module.exports = { }, { 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', } ] }, @@ -101,4 +87,4 @@ module.exports = { compress: true, port: 9000 } -};
\ No newline at end of file +}; |