@workleap/webpack-configs 1.0.8 → 1.1.1
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 +13 -0
- package/dist/build.d.ts +1 -1
- package/dist/build.js +2 -2
- package/dist/{chunk-NFWTRG4S.js → chunk-2MCAXFWL.js} +13 -3
- package/dist/chunk-2YARCRX5.js +15 -0
- package/dist/{chunk-TMMN6LWG.js → chunk-IDO2HXCS.js} +7 -10
- package/dist/dev.d.ts +1 -0
- package/dist/dev.js +2 -2
- package/dist/index.js +3 -3
- package/dist/utils.d.ts +4 -1
- package/dist/utils.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-P2Z3EEVF.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @workleap/webpack-configs
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#162](https://github.com/gsoft-inc/wl-web-configs/pull/162) [`fff9d08`](https://github.com/gsoft-inc/wl-web-configs/commit/fff9d087ebfe941fb38de8a46b3af79258f7f80d) Thanks [@patricklafrance](https://github.com/patricklafrance)! - - Removed the `build` config `preflight` function because it's not enforced by TypeScript typings.
|
|
8
|
+
- Updated the `build` config non-optimized options.
|
|
9
|
+
|
|
10
|
+
## 1.1.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [#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.
|
|
15
|
+
|
|
3
16
|
## 1.0.8
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/build.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function defineMiniCssExtractPluginConfig(options?: MiniCssExtractPlugin
|
|
|
10
10
|
interface DefineBuildConfigOptions {
|
|
11
11
|
entry?: string;
|
|
12
12
|
outputPath?: string;
|
|
13
|
-
publicPath?: string;
|
|
13
|
+
publicPath?: `${string}/` | "auto";
|
|
14
14
|
cache?: boolean;
|
|
15
15
|
cacheDirectory?: string;
|
|
16
16
|
moduleRules?: NonNullable<Configuration["module"]>["rules"];
|
package/dist/build.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-IDO2HXCS.js';
|
|
2
|
+
import './chunk-2YARCRX5.js';
|
|
3
3
|
import './chunk-QJI26K46.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isObject } from './chunk-
|
|
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-
|
|
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';
|
|
@@ -31,15 +31,7 @@ function defineMiniCssExtractPluginConfig(options = {}) {
|
|
|
31
31
|
filename
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function preflight(options) {
|
|
35
|
-
if (options.publicPath) {
|
|
36
|
-
if (!options.publicPath.endsWith("/")) {
|
|
37
|
-
throw new Error('[webpack-configs] The "publicPath" must end with a "/".');
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
34
|
function defineBuildConfig(swcConfig, options = {}) {
|
|
42
|
-
preflight(options);
|
|
43
35
|
const {
|
|
44
36
|
entry = path.resolve("./src/index.tsx"),
|
|
45
37
|
outputPath = path.resolve("dist"),
|
|
@@ -114,7 +106,12 @@ function defineBuildConfig(swcConfig, options = {}) {
|
|
|
114
106
|
} : {
|
|
115
107
|
minimize: false,
|
|
116
108
|
chunkIds: "named",
|
|
117
|
-
|
|
109
|
+
concatenateModules: false,
|
|
110
|
+
flagIncludedChunks: false,
|
|
111
|
+
mangleExports: false,
|
|
112
|
+
mangleWasmImports: false,
|
|
113
|
+
moduleIds: "named",
|
|
114
|
+
removeAvailableModules: false
|
|
118
115
|
},
|
|
119
116
|
infrastructureLogging: verbose ? {
|
|
120
117
|
appendOnly: true,
|
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-
|
|
2
|
-
import './chunk-
|
|
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-
|
|
2
|
-
export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-IDO2HXCS.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-
|
|
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.
|
|
5
|
+
"version": "1.1.1",
|
|
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": "
|
|
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"
|