@oroinc/oro-webpack-config-builder 6.0.0-lts03 → 6.0.0-lts04

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,8 +1,6 @@
1
- oro-webpack-config-builder
2
-
3
1
  The MIT License (MIT)
4
2
 
5
- Copyright (c) 2013, Oro, Inc.
3
+ Copyright (c) 2024 Oro Inc.
6
4
 
7
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
8
6
  of this software and associated documentation files (the "Software"), to deal
@@ -27,6 +27,7 @@ const validation = require('./validation');
27
27
  const EventEmitter = require('events');
28
28
  const ErrorHandler = require('./error-handler');
29
29
  const SVGSprite = require('./svg-sprite');
30
+ const TerserPlugin = require('terser-webpack-plugin');
30
31
  require('resolve-url-loader');
31
32
  require('lezer-loader');
32
33
 
@@ -290,7 +291,20 @@ class ConfigBuilder {
290
291
  cacheGroups: {
291
292
  defaultVendors: false
292
293
  }
293
- }
294
+ },
295
+ minimize: this._isProduction,
296
+ minimizer: [new TerserPlugin({
297
+ parallel: true,
298
+ extractComments: false,
299
+ minify: TerserPlugin.swcMinify,
300
+ terserOptions: {
301
+ compress: true,
302
+ mangle: true,
303
+ format: {
304
+ comments: false
305
+ }
306
+ }
307
+ })]
294
308
  },
295
309
  resolveLoader: {
296
310
  modules: [
@@ -423,7 +437,10 @@ class ConfigBuilder {
423
437
  // Additional setting for production mode
424
438
  if (this._isProduction) {
425
439
  webpackConfig.devtool = false;
426
- webpackConfig.plugins.push(new CssMinimizerPlugin());
440
+ webpackConfig.plugins.push(new CssMinimizerPlugin({
441
+ parallel: true,
442
+ minify: CssMinimizerPlugin.esbuildMinify
443
+ }));
427
444
  }
428
445
 
429
446
  return webpackConfig;
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@oroinc/oro-webpack-config-builder",
3
- "version": "6.0.0-lts03",
4
- "author": "Oro, Inc (https://www.oroinc.com)",
3
+ "version": "6.0.0-lts04",
4
+ "author": "Oro, Inc. (https://oroinc.com)",
5
5
  "license": "MIT",
6
6
  "description": "An integration of OroPlatform based applications with the Webpack.",
7
7
  "main": "oro-webpack-config.js",
8
8
  "dependencies": {
9
+ "@swc/core": "^1.11.8",
9
10
  "@babel/core": "~7.23.3",
10
11
  "@babel/plugin-transform-runtime": "~7.21.0",
11
12
  "@babel/preset-env": "~7.21.2",
@@ -17,6 +18,7 @@
17
18
  "deepmerge": "~4.3.1",
18
19
  "exports-loader": "~4.0.0",
19
20
  "expose-loader": "~4.1.0",
21
+ "esbuild-loader": "^4.3.0",
20
22
  "file-loader": "~6.2.0",
21
23
  "html-webpack-plugin": "~5.5.0",
22
24
  "imports-loader": "~4.0.1",
@@ -38,6 +40,7 @@
38
40
  "svgo": "^3.0.2",
39
41
  "svgstore": "^3.0.1",
40
42
  "terser": "~5.17.1",
43
+ "terser-webpack-plugin": "^5.3.13",
41
44
  "text-loader": "0.0.1",
42
45
  "underscore": "1.13.*",
43
46
  "url-loader": "~4.1.1",
@@ -118,8 +118,8 @@ class SvgSprite {
118
118
 
119
119
  /**
120
120
  * @param {Array} files
121
- @returns {{ filesList: {}, rtlFilesList: {}|undefined }}
122
- */
121
+ @returns {{ filesList: {}, rtlFilesList: {}|undefined }}
122
+ */
123
123
  createSpriteMap(files) {
124
124
  const SVGFiles = files.filter(file => path.extname(file) === '.svg');
125
125
  const {rtl_support: rtl} = this.themeConfig;