@workleap/webpack-configs 1.0.8 → 1.1.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,11 @@
1
1
  # @workleap/webpack-configs
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#155](https://github.com/gsoft-inc/wl-web-configs/pull/155) [`5a02365`](https://github.com/gsoft-inc/wl-web-configs/commit/5a02365e18b002c48c20e4ae23114d7063027b2f) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Added an overlay predefined options for the webpack config.
8
+
3
9
  ## 1.0.8
4
10
 
5
11
  ### Patch Changes
package/dist/build.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-TMMN6LWG.js';
2
- import './chunk-P2Z3EEVF.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-MVNLHMHU.js';
2
+ import './chunk-2YARCRX5.js';
3
3
  import './chunk-QJI26K46.js';
@@ -1,4 +1,4 @@
1
- import { isObject } from './chunk-P2Z3EEVF.js';
1
+ import { isObject, isNil } from './chunk-2YARCRX5.js';
2
2
  import { applyTransformers } from './chunk-QJI26K46.js';
3
3
  import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
4
4
  import HtmlWebpackPlugin from 'html-webpack-plugin';
@@ -35,6 +35,12 @@ function trySetSwcFastRefresh(config, enabled) {
35
35
  }
36
36
  return config;
37
37
  }
38
+ function trySetFastRefreshOverlay(options, overlay) {
39
+ if (overlay === false && isNil(options.overlay)) {
40
+ options.overlay = false;
41
+ }
42
+ return options;
43
+ }
38
44
  function defineDevConfig(swcConfig, options = {}) {
39
45
  preflight();
40
46
  const {
@@ -49,6 +55,7 @@ function defineDevConfig(swcConfig, options = {}) {
49
55
  htmlWebpackPlugin = defineDevHtmlWebpackPluginConfig(),
50
56
  fastRefresh = true,
51
57
  cssModules = false,
58
+ overlay,
52
59
  // Using an empty object literal as the default value to ensure
53
60
  // "process.env" is always available.
54
61
  environmentVariables = {},
@@ -66,7 +73,10 @@ function defineDevConfig(swcConfig, options = {}) {
66
73
  https,
67
74
  host,
68
75
  port,
69
- historyApiFallback: true
76
+ historyApiFallback: true,
77
+ client: overlay === false || fastRefresh ? {
78
+ overlay: false
79
+ } : void 0
70
80
  },
71
81
  entry,
72
82
  output: {
@@ -179,7 +189,7 @@ function defineDevConfig(swcConfig, options = {}) {
179
189
  return acc;
180
190
  }, {})
181
191
  }),
182
- fastRefresh && new ReactRefreshWebpackPlugin(isObject(fastRefresh) ? fastRefresh : defineFastRefreshPluginConfig()),
192
+ fastRefresh && new ReactRefreshWebpackPlugin(trySetFastRefreshOverlay(isObject(fastRefresh) ? fastRefresh : defineFastRefreshPluginConfig(), overlay)),
183
193
  ...plugins
184
194
  ].filter(Boolean)
185
195
  };
@@ -0,0 +1,15 @@
1
+ // src/utils.ts
2
+ function isObject(value) {
3
+ return typeof value === "object" && !Array.isArray(value) && value != null;
4
+ }
5
+ function isNull(value) {
6
+ return value == null;
7
+ }
8
+ function isUndefined(value) {
9
+ return typeof value === "undefined" || value === void 0;
10
+ }
11
+ function isNil(value) {
12
+ return isNull(value) || isUndefined(value);
13
+ }
14
+
15
+ export { isNil, isNull, isObject, isUndefined };
@@ -1,4 +1,4 @@
1
- import { isObject } from './chunk-P2Z3EEVF.js';
1
+ import { isObject } from './chunk-2YARCRX5.js';
2
2
  import { applyTransformers } from './chunk-QJI26K46.js';
3
3
  import HtmlWebpackPlugin from 'html-webpack-plugin';
4
4
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
package/dist/dev.d.ts CHANGED
@@ -18,6 +18,7 @@ interface DefineDevConfigOptions {
18
18
  htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
19
19
  fastRefresh?: boolean | ReactRefreshPluginOptions;
20
20
  cssModules?: boolean;
21
+ overlay?: false;
21
22
  environmentVariables?: Record<string, unknown>;
22
23
  transformers?: WebpackConfigTransformer[];
23
24
  verbose?: boolean;
package/dist/dev.js CHANGED
@@ -1,3 +1,3 @@
1
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-NFWTRG4S.js';
2
- import './chunk-P2Z3EEVF.js';
1
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-2MCAXFWL.js';
2
+ import './chunk-2YARCRX5.js';
3
3
  import './chunk-QJI26K46.js';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-TMMN6LWG.js';
2
- export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-NFWTRG4S.js';
3
- import './chunk-P2Z3EEVF.js';
1
+ export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-MVNLHMHU.js';
2
+ export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-2MCAXFWL.js';
3
+ import './chunk-2YARCRX5.js';
4
4
  import './chunk-QJI26K46.js';
5
5
  export { addAfterModuleRule, addBeforeModuleRule, findModuleRule, findModuleRules, matchAssetModuleType, matchLoaderName, matchTest, removeModuleRules, replaceModuleRule } from './chunk-34O5ZLZ6.js';
6
6
  export { addAfterPlugin, addBeforePlugin, findPlugin, matchConstructorName, removePlugin, replacePlugin } from './chunk-JPURRV2F.js';
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,6 @@
1
1
  declare function isObject(value: any): value is Record<string, unknown>;
2
+ declare function isNull(value: any): value is null;
3
+ declare function isUndefined(value: any): value is undefined;
4
+ declare function isNil(value: any): value is null | undefined;
2
5
 
3
- export { isObject };
6
+ export { isNil, isNull, isObject, isUndefined };
package/dist/utils.js CHANGED
@@ -1 +1 @@
1
- export { isObject } from './chunk-P2Z3EEVF.js';
1
+ export { isNil, isNull, isObject, isUndefined } from './chunk-2YARCRX5.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.8",
5
+ "version": "1.1.0",
6
6
  "license": "Apache-2.0",
7
7
  "keywords": [
8
8
  "workleap",
@@ -66,7 +66,7 @@
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.1",
69
+ "@workleap/eslint-plugin": "3.0.0",
70
70
  "@workleap/swc-configs": "2.1.2",
71
71
  "@workleap/tsup-configs": "3.0.1",
72
72
  "@workleap/typescript-configs": "3.0.2"
@@ -1,6 +0,0 @@
1
- // src/utils.ts
2
- function isObject(value) {
3
- return typeof value === "object" && !Array.isArray(value) && value != null;
4
- }
5
-
6
- export { isObject };