@workleap/webpack-configs 1.0.6 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @workleap/webpack-configs
2
2
 
3
+ ## 1.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146](https://github.com/gsoft-inc/wl-web-configs/pull/146) [`0b259b0`](https://github.com/gsoft-inc/wl-web-configs/commit/0b259b0849e32c49f78be2f9869a5daea0b4c6f3) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Replaced build option "minify" for "optimize"
8
+
9
+ ## 1.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#143](https://github.com/gsoft-inc/wl-web-configs/pull/143) [`334088f`](https://github.com/gsoft-inc/wl-web-configs/commit/334088fac63aad6cc245ee3300da076e5c201287) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated to SWC 1.3.85
14
+
3
15
  ## 1.0.6
4
16
 
5
17
  ### Patch Changes
package/dist/build.d.ts CHANGED
@@ -17,7 +17,7 @@ interface DefineBuildConfigOptions {
17
17
  plugins?: Configuration["plugins"];
18
18
  htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
19
19
  miniCssExtractPluginOptions?: MiniCssExtractPluginOptions;
20
- minify?: boolean;
20
+ optimize?: boolean;
21
21
  cssModules?: boolean;
22
22
  environmentVariables?: Record<string, unknown>;
23
23
  transformers?: WebpackConfigTransformer[];
package/dist/build.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-FXES4JZF.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-TMMN6LWG.js';
2
2
  import './chunk-P2Z3EEVF.js';
3
3
  import './chunk-QJI26K46.js';
@@ -4,11 +4,13 @@ import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
4
4
  import HtmlWebpackPlugin from 'html-webpack-plugin';
5
5
  import { createRequire } from 'node:module';
6
6
  import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
7
8
  import webpack from 'webpack';
8
9
  import 'webpack-dev-server';
9
10
 
10
11
  var DefinePlugin = webpack.DefinePlugin;
11
12
  var require2 = createRequire(import.meta.url);
13
+ var __filename = fileURLToPath(import.meta.url);
12
14
  function defineDevHtmlWebpackPluginConfig(options = {}) {
13
15
  const {
14
16
  template = path.resolve("./public/index.html"),
@@ -75,8 +77,13 @@ function defineDevConfig(swcConfig, options = {}) {
75
77
  type: "filesystem",
76
78
  allowCollectingMemory: true,
77
79
  maxMemoryGenerations: 1,
78
- cacheDirectory
80
+ cacheDirectory,
81
+ // Took from https://webpack.js.org/configuration/cache/#cachebuilddependencies.
82
+ buildDependencies: {
83
+ config: [__filename]
84
+ }
79
85
  },
86
+ // (ACTUALLY NOT FIXING ANYTHING AT THE MOMENT)
80
87
  // Fixes caching for environmental variables using the DefinePlugin by forcing
81
88
  // webpack caching to prioritize hashes over timestamps.
82
89
  snapshot: cache ? {
@@ -4,11 +4,13 @@ import HtmlWebpackPlugin from 'html-webpack-plugin';
4
4
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
5
5
  import { createRequire } from 'node:module';
6
6
  import path from 'node:path';
7
+ import { fileURLToPath } from 'node:url';
7
8
  import TerserPlugin from 'terser-webpack-plugin';
8
9
  import webpack from 'webpack';
9
10
 
10
11
  var DefinePlugin = webpack.DefinePlugin;
11
12
  var require2 = createRequire(import.meta.url);
13
+ var __filename = fileURLToPath(import.meta.url);
12
14
  function defineBuildHtmlWebpackPluginConfig(options = {}) {
13
15
  const {
14
16
  template = path.resolve("./public/index.html"),
@@ -49,7 +51,7 @@ function defineBuildConfig(swcConfig, options = {}) {
49
51
  plugins = [],
50
52
  htmlWebpackPlugin = defineBuildHtmlWebpackPluginConfig(),
51
53
  miniCssExtractPluginOptions = defineMiniCssExtractPluginConfig(),
52
- minify = true,
54
+ optimize = true,
53
55
  cssModules = false,
54
56
  // Using an empty object literal as the default value to ensure
55
57
  // "process.env" is always available.
@@ -70,8 +72,14 @@ function defineBuildConfig(swcConfig, options = {}) {
70
72
  cache: cache && {
71
73
  type: "filesystem",
72
74
  allowCollectingMemory: false,
73
- cacheDirectory
75
+ cacheDirectory,
76
+ maxMemoryGenerations: 1,
77
+ // Took from https://webpack.js.org/configuration/cache/#cachebuilddependencies.
78
+ buildDependencies: {
79
+ config: [__filename]
80
+ }
74
81
  },
82
+ // (ACTUALLY NOT FIXING ANYTHING AT THE MOMENT)
75
83
  // Fixes caching for environmental variables using the DefinePlugin by forcing
76
84
  // webpack caching to prioritize hashes over timestamps.
77
85
  snapshot: cache ? {
@@ -92,7 +100,7 @@ function defineBuildConfig(swcConfig, options = {}) {
92
100
  timestamp: true
93
101
  }
94
102
  } : void 0,
95
- optimization: minify ? {
103
+ optimization: optimize ? {
96
104
  minimize: true,
97
105
  minimizer: [
98
106
  new TerserPlugin({
@@ -103,7 +111,11 @@ function defineBuildConfig(swcConfig, options = {}) {
103
111
  }
104
112
  })
105
113
  ]
106
- } : void 0,
114
+ } : {
115
+ minimize: false,
116
+ chunkIds: "named",
117
+ moduleIds: "named"
118
+ },
107
119
  infrastructureLogging: verbose ? {
108
120
  appendOnly: true,
109
121
  level: "verbose",
package/dist/dev.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-ZBXE4VAX.js';
1
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-NFWTRG4S.js';
2
2
  import './chunk-P2Z3EEVF.js';
3
3
  import './chunk-QJI26K46.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-FXES4JZF.js';
2
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-ZBXE4VAX.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-TMMN6LWG.js';
2
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-NFWTRG4S.js';
3
3
  import './chunk-P2Z3EEVF.js';
4
4
  import './chunk-QJI26K46.js';
5
5
  export { addAfterModuleRule, addBeforeModuleRule, findModuleRule, findModuleRules, matchAssetModuleType, matchLoaderName, matchTest, removeModuleRules, replaceModuleRule } from './chunk-34O5ZLZ6.js';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@workleap/webpack-configs",
3
3
  "author": "Workleap",
4
4
  "description": "Workleap recommended webpack config.",
5
- "version": "1.0.6",
5
+ "version": "1.0.8",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "workleap",
@@ -52,13 +52,13 @@
52
52
  }
53
53
  },
54
54
  "devDependencies": {
55
- "@swc/core": "1.3.82",
56
- "@swc/helpers": "0.5.1",
55
+ "@swc/core": "1.3.85",
56
+ "@swc/helpers": "0.5.2",
57
57
  "@swc/jest": "0.2.29",
58
- "@types/jest": "29.5.4",
59
- "@types/node": "20.5.7",
58
+ "@types/jest": "29.5.5",
59
+ "@types/node": "20.6.2",
60
60
  "browserslist": "4.21.10",
61
- "jest": "29.6.4",
61
+ "jest": "29.7.0",
62
62
  "postcss": "8.4.29",
63
63
  "postcss-load-config": "4.0.1",
64
64
  "ts-node": "10.9.1",
@@ -66,9 +66,9 @@
66
66
  "typescript": "5.2.2",
67
67
  "webpack": "5.88.2",
68
68
  "webpack-dev-server": "4.15.1",
69
- "@workleap/eslint-plugin": "2.1.0",
70
- "@workleap/swc-configs": "2.1.1",
71
- "@workleap/tsup-configs": "3.0.0",
69
+ "@workleap/eslint-plugin": "2.1.1",
70
+ "@workleap/swc-configs": "2.1.2",
71
+ "@workleap/tsup-configs": "3.0.1",
72
72
  "@workleap/typescript-configs": "3.0.2"
73
73
  },
74
74
  "publishConfig": {