@openmrs/webpack-config 3.4.1-pre.176 → 3.4.1-pre.180
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/.turbo/turbo-build.log +1 -1
- package/dist/index.js +5 -1
- package/package.json +2 -2
- package/src/index.ts +13 -4
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
[35m@openmrs/webpack-config:build: [0mcache hit, replaying output [
|
|
1
|
+
[35m@openmrs/webpack-config:build: [0mcache hit, replaying output [2mcc0ba2cb3bdbf695[0m
|
|
2
2
|
[35m@openmrs/webpack-config:build: [0m$ tsc
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ const webpack_stats_plugin_1 = require("webpack-stats-plugin");
|
|
|
13
13
|
// eslint-disable-next-line no-restricted-imports
|
|
14
14
|
const lodash_1 = require("lodash");
|
|
15
15
|
const optimize_1 = require("./optimize");
|
|
16
|
+
const semver_1 = require("semver");
|
|
16
17
|
const production = "production";
|
|
17
18
|
const { ModuleFederationPlugin } = webpack_1.container;
|
|
18
19
|
function getFrameworkVersion() {
|
|
@@ -76,7 +77,7 @@ exports.scssRuleConfig = {};
|
|
|
76
77
|
exports.assetRuleConfig = {};
|
|
77
78
|
exports.default = (env, argv = {}) => {
|
|
78
79
|
const root = process.cwd();
|
|
79
|
-
const { name, peerDependencies, browser, main, types } = require((0, path_1.resolve)(root, "package.json"));
|
|
80
|
+
const { name, version, peerDependencies, browser, main, types, } = require((0, path_1.resolve)(root, "package.json"));
|
|
80
81
|
const mode = argv.mode || process.env.NODE_ENV || "development";
|
|
81
82
|
const filename = (0, path_1.basename)(browser || main);
|
|
82
83
|
const outDir = (0, path_1.dirname)(browser || main);
|
|
@@ -142,6 +143,9 @@ exports.default = (env, argv = {}) => {
|
|
|
142
143
|
analyzerMode: env && env.analyze ? "server" : "disabled",
|
|
143
144
|
}),
|
|
144
145
|
new webpack_1.DefinePlugin({
|
|
146
|
+
__VERSION__: mode === production
|
|
147
|
+
? JSON.stringify(version)
|
|
148
|
+
: JSON.stringify((0, semver_1.inc)(version, "prerelease", "local")),
|
|
145
149
|
"process.env.FRAMEWORK_VERSION": JSON.stringify(frameworkVersion),
|
|
146
150
|
}),
|
|
147
151
|
new ModuleFederationPlugin({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/webpack-config",
|
|
3
|
-
"version": "3.4.1-pre.
|
|
3
|
+
"version": "3.4.1-pre.180",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "src/index.ts",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"typescript": "~4.5.2",
|
|
54
54
|
"webpack": "^5.64.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "ee733435ce5f9bf892a915a6b04cef861426077d"
|
|
57
57
|
}
|
package/src/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { StatsWriterPlugin } from "webpack-stats-plugin";
|
|
|
7
7
|
// eslint-disable-next-line no-restricted-imports
|
|
8
8
|
import { merge, mergeWith, isArray } from "lodash";
|
|
9
9
|
import { postProcessFile } from "./optimize";
|
|
10
|
+
import { inc } from "semver";
|
|
10
11
|
|
|
11
12
|
const production = "production";
|
|
12
13
|
const { ModuleFederationPlugin } = container;
|
|
@@ -85,10 +86,14 @@ export default (
|
|
|
85
86
|
argv: Record<string, string> = {}
|
|
86
87
|
) => {
|
|
87
88
|
const root = process.cwd();
|
|
88
|
-
const {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
const {
|
|
90
|
+
name,
|
|
91
|
+
version,
|
|
92
|
+
peerDependencies,
|
|
93
|
+
browser,
|
|
94
|
+
main,
|
|
95
|
+
types,
|
|
96
|
+
} = require(resolve(root, "package.json"));
|
|
92
97
|
const mode = argv.mode || process.env.NODE_ENV || "development";
|
|
93
98
|
const filename = basename(browser || main);
|
|
94
99
|
const outDir = dirname(browser || main);
|
|
@@ -177,6 +182,10 @@ export default (
|
|
|
177
182
|
analyzerMode: env && env.analyze ? "server" : "disabled",
|
|
178
183
|
}),
|
|
179
184
|
new DefinePlugin({
|
|
185
|
+
__VERSION__:
|
|
186
|
+
mode === production
|
|
187
|
+
? JSON.stringify(version)
|
|
188
|
+
: JSON.stringify(inc(version, "prerelease", "local")),
|
|
180
189
|
"process.env.FRAMEWORK_VERSION": JSON.stringify(frameworkVersion),
|
|
181
190
|
}),
|
|
182
191
|
new ModuleFederationPlugin({
|