@workleap/webpack-configs 1.4.1 → 1.5.0

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.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#190](https://github.com/gsoft-inc/wl-web-configs/pull/190) [`b6246b3`](https://github.com/gsoft-inc/wl-web-configs/commit/b6246b30a505821e36b09579fb14e3c0f99c963a) Thanks [@bsokol-wl](https://github.com/bsokol-wl)! - Enable in-memory webpack cache by default
8
+
9
+ ## 1.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [#188](https://github.com/gsoft-inc/wl-web-configs/pull/188) [`37b6253`](https://github.com/gsoft-inc/wl-web-configs/commit/37b625375848907b34a5c86bd95de69b25a5342f) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Updated dependencies.
14
+
3
15
  ## 1.4.1
4
16
 
5
17
  ### Patch Changes
package/dist/build.d.ts CHANGED
@@ -15,8 +15,6 @@ interface DefineBuildConfigOptions {
15
15
  entry?: string;
16
16
  outputPath?: string;
17
17
  publicPath?: `${string}/` | "auto";
18
- cache?: boolean;
19
- cacheDirectory?: string;
20
18
  moduleRules?: NonNullable<Configuration["module"]>["rules"];
21
19
  plugins?: Configuration["plugins"];
22
20
  htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
package/dist/build.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig, getOptimizationConfig } from './chunk-N4YYH3H2.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig, getOptimizationConfig } from './chunk-KCMV3N5J.js';
2
2
  import './chunk-2YARCRX5.js';
3
3
  import './chunk-5ACA7GOB.js';
@@ -4,13 +4,11 @@ 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';
8
7
  import webpack from 'webpack';
9
8
  import 'webpack-dev-server';
10
9
 
11
10
  var DefinePlugin = webpack.DefinePlugin;
12
11
  var require2 = createRequire(import.meta.url);
13
- var __filename = fileURLToPath(import.meta.url);
14
12
  function defineDevHtmlWebpackPluginConfig(options = {}) {
15
13
  const {
16
14
  template = path.resolve("./public/index.html"),
@@ -50,7 +48,6 @@ function defineDevConfig(swcConfig, options = {}) {
50
48
  port = 8080,
51
49
  publicPath,
52
50
  cache = true,
53
- cacheDirectory = path.resolve("node_modules/.cache/webpack"),
54
51
  moduleRules = [],
55
52
  plugins = [],
56
53
  htmlWebpackPlugin = defineDevHtmlWebpackPluginConfig(),
@@ -89,36 +86,9 @@ function defineDevConfig(swcConfig, options = {}) {
89
86
  publicPath: publicPath ?? `${https ? "https" : "http"}://${host}:${port}/`
90
87
  },
91
88
  cache: cache && {
92
- type: "filesystem",
93
- allowCollectingMemory: true,
94
- maxMemoryGenerations: 1,
95
- cacheDirectory,
96
- // Took from https://webpack.js.org/configuration/cache/#cachebuilddependencies.
97
- buildDependencies: {
98
- config: [__filename]
99
- }
89
+ type: "memory",
90
+ maxGenerations: 1
100
91
  },
101
- // (ACTUALLY NOT FIXING ANYTHING AT THE MOMENT)
102
- // Fixes caching for environmental variables using the DefinePlugin by forcing
103
- // webpack caching to prioritize hashes over timestamps.
104
- snapshot: cache ? {
105
- buildDependencies: {
106
- hash: true,
107
- timestamp: true
108
- },
109
- module: {
110
- hash: true,
111
- timestamp: true
112
- },
113
- resolve: {
114
- hash: true,
115
- timestamp: true
116
- },
117
- resolveBuildDependencies: {
118
- hash: true,
119
- timestamp: true
120
- }
121
- } : void 0,
122
92
  // See: https://webpack.js.org/guides/build-performance/#avoid-extra-optimization-steps
123
93
  optimization: {
124
94
  // Keep "runtimeChunk" to false, otherwise it breaks module federation
@@ -4,13 +4,11 @@ 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';
8
7
  import TerserPlugin from 'terser-webpack-plugin';
9
8
  import webpack from 'webpack';
10
9
 
11
10
  var DefinePlugin = webpack.DefinePlugin;
12
11
  var require2 = createRequire(import.meta.url);
13
- var __filename = fileURLToPath(import.meta.url);
14
12
  function defineBuildHtmlWebpackPluginConfig(options = {}) {
15
13
  const {
16
14
  template = path.resolve("./public/index.html"),
@@ -86,8 +84,6 @@ function defineBuildConfig(swcConfig, options = {}) {
86
84
  outputPath = path.resolve("dist"),
87
85
  // The trailing / is very important, otherwise paths will not be resolved correctly.
88
86
  publicPath = "http://localhost:8080/",
89
- cache = true,
90
- cacheDirectory = path.resolve("node_modules/.cache/webpack"),
91
87
  moduleRules = [],
92
88
  plugins = [],
93
89
  htmlWebpackPlugin = defineBuildHtmlWebpackPluginConfig(),
@@ -111,37 +107,6 @@ function defineBuildConfig(swcConfig, options = {}) {
111
107
  publicPath,
112
108
  clean: true
113
109
  },
114
- cache: cache && {
115
- type: "filesystem",
116
- allowCollectingMemory: false,
117
- cacheDirectory,
118
- maxMemoryGenerations: 1,
119
- // Took from https://webpack.js.org/configuration/cache/#cachebuilddependencies.
120
- buildDependencies: {
121
- config: [__filename]
122
- }
123
- },
124
- // (ACTUALLY NOT FIXING ANYTHING AT THE MOMENT)
125
- // Fixes caching for environmental variables using the DefinePlugin by forcing
126
- // webpack caching to prioritize hashes over timestamps.
127
- snapshot: cache ? {
128
- buildDependencies: {
129
- hash: true,
130
- timestamp: true
131
- },
132
- module: {
133
- hash: true,
134
- timestamp: true
135
- },
136
- resolve: {
137
- hash: true,
138
- timestamp: true
139
- },
140
- resolveBuildDependencies: {
141
- hash: true,
142
- timestamp: true
143
- }
144
- } : void 0,
145
110
  optimization: getOptimizationConfig(optimize),
146
111
  infrastructureLogging: verbose ? {
147
112
  appendOnly: true,
package/dist/dev.d.ts CHANGED
@@ -15,7 +15,6 @@ interface DefineDevConfigOptions {
15
15
  port?: number;
16
16
  publicPath?: `${string}/` | "auto";
17
17
  cache?: boolean;
18
- cacheDirectory?: string;
19
18
  moduleRules?: NonNullable<Configuration["module"]>["rules"];
20
19
  plugins?: Configuration["plugins"];
21
20
  htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
package/dist/dev.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-AKXI7IRH.js';
1
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-JU2EHEXW.js';
2
2
  import './chunk-2YARCRX5.js';
3
3
  import './chunk-5ACA7GOB.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig, getOptimizationConfig } from './chunk-N4YYH3H2.js';
2
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-AKXI7IRH.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig, getOptimizationConfig } from './chunk-KCMV3N5J.js';
2
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-JU2EHEXW.js';
3
3
  import './chunk-2YARCRX5.js';
4
4
  import './chunk-5ACA7GOB.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.4.1",
5
+ "version": "1.5.0",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "workleap",
@@ -67,6 +67,7 @@
67
67
  "html-webpack-plugin": "^5.6.0",
68
68
  "mini-css-extract-plugin": "^2.8.1",
69
69
  "postcss-loader": "^8.1.1",
70
+ "react-refresh": "^0.14.0",
70
71
  "style-loader": "^3.3.4",
71
72
  "swc-loader": "^0.2.6",
72
73
  "terser-webpack-plugin": "^5.3.10"