@workleap/webpack-configs 1.0.3 → 1.0.4
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 +6 -0
- package/dist/build.d.ts +2 -2
- package/dist/build.js +2 -1
- package/dist/{chunk-EYIS42GE.js → chunk-IAMDZMFH.js} +8 -3
- package/dist/{chunk-2Q5IGCCY.js → chunk-NQR5SLK3.js} +9 -3
- package/dist/dev.d.ts +2 -2
- package/dist/dev.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/webpack-configs
|
|
2
2
|
|
|
3
|
+
## 1.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#127](https://github.com/gsoft-inc/wl-web-configs/pull/127) [`f440b12`](https://github.com/gsoft-inc/wl-web-configs/commit/f440b1251e2b3c1960dfc7f68bd090f573ec67d6) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Fix environment variables
|
|
8
|
+
|
|
3
9
|
## 1.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/build.d.ts
CHANGED
|
@@ -15,11 +15,11 @@ interface DefineBuildConfigOptions {
|
|
|
15
15
|
cacheDirectory?: string;
|
|
16
16
|
moduleRules?: NonNullable<Configuration["module"]>["rules"];
|
|
17
17
|
plugins?: Configuration["plugins"];
|
|
18
|
-
htmlWebpackPlugin?:
|
|
18
|
+
htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
|
|
19
19
|
miniCssExtractPluginOptions?: MiniCssExtractPluginOptions;
|
|
20
20
|
minify?: boolean;
|
|
21
21
|
cssModules?: boolean;
|
|
22
|
-
environmentVariables?: Record<string,
|
|
22
|
+
environmentVariables?: Record<string, unknown>;
|
|
23
23
|
transformers?: WebpackConfigTransformer[];
|
|
24
24
|
profile?: boolean;
|
|
25
25
|
}
|
package/dist/build.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-
|
|
1
|
+
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-NQR5SLK3.js';
|
|
2
|
+
import './chunk-P2Z3EEVF.js';
|
|
2
3
|
import './chunk-EF2WO5MC.js';
|
|
@@ -171,10 +171,15 @@ function defineDevConfig(swcConfig, options = {}) {
|
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
plugins: [
|
|
174
|
-
htmlWebpackPlugin && new HtmlWebpackPlugin(htmlWebpackPlugin),
|
|
174
|
+
htmlWebpackPlugin && new HtmlWebpackPlugin(isObject(htmlWebpackPlugin) ? htmlWebpackPlugin : defineDevHtmlWebpackPluginConfig()),
|
|
175
|
+
// Stringify the environment variables because the plugin does a direct text replacement. Otherwise, "production" would become production
|
|
176
|
+
// after replacement and cause an undefined var error.
|
|
177
|
+
// For more information, view: https://webpack.js.org/plugins/define-plugin/.
|
|
175
178
|
new DefinePlugin({
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
"process.env": Object.keys(environmentVariables).reduce((acc, key) => {
|
|
180
|
+
acc[key] = JSON.stringify(environmentVariables[key]);
|
|
181
|
+
return acc;
|
|
182
|
+
}, {})
|
|
178
183
|
}),
|
|
179
184
|
fastRefresh && new ReactRefreshWebpackPlugin(isObject(fastRefresh) ? fastRefresh : defineFastRefreshPluginConfig()),
|
|
180
185
|
...plugins
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isObject } from './chunk-P2Z3EEVF.js';
|
|
1
2
|
import { applyTransformers } from './chunk-EF2WO5MC.js';
|
|
2
3
|
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
|
3
4
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
@@ -155,11 +156,16 @@ function defineBuildConfig(swcConfig, options = {}) {
|
|
|
155
156
|
}
|
|
156
157
|
},
|
|
157
158
|
plugins: [
|
|
158
|
-
htmlWebpackPlugin && new HtmlWebpackPlugin(htmlWebpackPlugin),
|
|
159
|
+
htmlWebpackPlugin && new HtmlWebpackPlugin(isObject(htmlWebpackPlugin) ? htmlWebpackPlugin : defineBuildHtmlWebpackPluginConfig()),
|
|
159
160
|
new MiniCssExtractPlugin(miniCssExtractPluginOptions),
|
|
161
|
+
// Stringify the environment variables because the plugin does a direct text replacement. Otherwise, "production" would become production
|
|
162
|
+
// after replacement and cause an undefined var error because the production var doesn't exist.
|
|
163
|
+
// For more information, view: https://webpack.js.org/plugins/define-plugin.
|
|
160
164
|
new DefinePlugin({
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
"process.env": Object.keys(environmentVariables).reduce((acc, key) => {
|
|
166
|
+
acc[key] = JSON.stringify(environmentVariables[key]);
|
|
167
|
+
return acc;
|
|
168
|
+
}, {})
|
|
163
169
|
}),
|
|
164
170
|
...plugins
|
|
165
171
|
].filter(Boolean)
|
package/dist/dev.d.ts
CHANGED
|
@@ -15,10 +15,10 @@ interface DefineDevConfigOptions {
|
|
|
15
15
|
cacheDirectory?: string;
|
|
16
16
|
moduleRules?: NonNullable<Configuration["module"]>["rules"];
|
|
17
17
|
plugins?: Configuration["plugins"];
|
|
18
|
-
htmlWebpackPlugin?:
|
|
18
|
+
htmlWebpackPlugin?: boolean | HtmlWebpackPlugin.Options;
|
|
19
19
|
fastRefresh?: boolean | ReactRefreshPluginOptions;
|
|
20
20
|
cssModules?: boolean;
|
|
21
|
-
environmentVariables?: Record<string,
|
|
21
|
+
environmentVariables?: Record<string, unknown>;
|
|
22
22
|
transformers?: WebpackConfigTransformer[];
|
|
23
23
|
profile?: boolean;
|
|
24
24
|
}
|
package/dist/dev.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-
|
|
1
|
+
export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-IAMDZMFH.js';
|
|
2
2
|
import './chunk-P2Z3EEVF.js';
|
|
3
3
|
import './chunk-EF2WO5MC.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-
|
|
2
|
-
export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-
|
|
1
|
+
export { defineBuildConfig, defineBuildHtmlWebpackPluginConfig, defineMiniCssExtractPluginConfig } from './chunk-NQR5SLK3.js';
|
|
2
|
+
export { defineDevConfig, defineDevHtmlWebpackPluginConfig, defineFastRefreshPluginConfig } from './chunk-IAMDZMFH.js';
|
|
3
3
|
import './chunk-P2Z3EEVF.js';
|
|
4
4
|
import './chunk-EF2WO5MC.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.
|
|
5
|
+
"version": "1.0.4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"workleap",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"@swc/helpers": "0.5.1",
|
|
57
57
|
"@swc/jest": "0.2.29",
|
|
58
58
|
"@types/jest": "29.5.4",
|
|
59
|
+
"@types/node": "20.5.7",
|
|
59
60
|
"browserslist": "4.21.10",
|
|
60
61
|
"jest": "29.6.4",
|
|
61
62
|
"postcss": "8.4.29",
|
|
@@ -66,9 +67,9 @@
|
|
|
66
67
|
"webpack": "5.88.2",
|
|
67
68
|
"webpack-dev-server": "4.15.1",
|
|
68
69
|
"@workleap/eslint-plugin": "2.1.0",
|
|
69
|
-
"@workleap/
|
|
70
|
+
"@workleap/swc-configs": "2.1.1",
|
|
70
71
|
"@workleap/typescript-configs": "3.0.2",
|
|
71
|
-
"@workleap/
|
|
72
|
+
"@workleap/tsup-configs": "3.0.0"
|
|
72
73
|
},
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public",
|