@utoo/pack 1.0.4 → 1.0.5

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.
@@ -100,7 +100,20 @@ function compatFromWebpackPlugin(webpackPlugins, picker) {
100
100
  }
101
101
  compatDefine.pluginName = "DefinePlugin";
102
102
  function compatDefine(maybeWebpackPluginInstance) {
103
- return maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
103
+ const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
104
+ if (!definitions || typeof definitions !== "object") {
105
+ return definitions;
106
+ }
107
+ const processedDefinitions = {};
108
+ for (const [key, value] of Object.entries(definitions)) {
109
+ if (typeof value === "object" && value !== null) {
110
+ processedDefinitions[key] = JSON.stringify(value);
111
+ }
112
+ else {
113
+ processedDefinitions[key] = value;
114
+ }
115
+ }
116
+ return processedDefinitions;
104
117
  }
105
118
  function compatExternals(webpackExternals) {
106
119
  if (!webpackExternals) {
@@ -97,7 +97,20 @@ function compatFromWebpackPlugin(webpackPlugins, picker) {
97
97
  }
98
98
  compatDefine.pluginName = "DefinePlugin";
99
99
  function compatDefine(maybeWebpackPluginInstance) {
100
- return maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
100
+ const definitions = maybeWebpackPluginInstance === null || maybeWebpackPluginInstance === void 0 ? void 0 : maybeWebpackPluginInstance.definitions;
101
+ if (!definitions || typeof definitions !== "object") {
102
+ return definitions;
103
+ }
104
+ const processedDefinitions = {};
105
+ for (const [key, value] of Object.entries(definitions)) {
106
+ if (typeof value === "object" && value !== null) {
107
+ processedDefinitions[key] = JSON.stringify(value);
108
+ }
109
+ else {
110
+ processedDefinitions[key] = value;
111
+ }
112
+ }
113
+ return processedDefinitions;
101
114
  }
102
115
  function compatExternals(webpackExternals) {
103
116
  if (!webpackExternals) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utoo/pack",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "cjs/index.js",
5
5
  "module": "esm/index.js",
6
6
  "exports": {
@@ -85,12 +85,12 @@
85
85
  },
86
86
  "repository": "git@github.com:utooland/utoo.git",
87
87
  "optionalDependencies": {
88
- "@utoo/pack-darwin-arm64": "1.0.4",
89
- "@utoo/pack-darwin-x64": "1.0.4",
90
- "@utoo/pack-linux-arm64-gnu": "1.0.4",
91
- "@utoo/pack-linux-arm64-musl": "1.0.4",
92
- "@utoo/pack-linux-x64-gnu": "1.0.4",
93
- "@utoo/pack-linux-x64-musl": "1.0.4",
94
- "@utoo/pack-win32-x64-msvc": "1.0.4"
88
+ "@utoo/pack-darwin-arm64": "1.0.5",
89
+ "@utoo/pack-darwin-x64": "1.0.5",
90
+ "@utoo/pack-linux-arm64-gnu": "1.0.5",
91
+ "@utoo/pack-linux-arm64-musl": "1.0.5",
92
+ "@utoo/pack-linux-x64-gnu": "1.0.5",
93
+ "@utoo/pack-linux-x64-musl": "1.0.5",
94
+ "@utoo/pack-win32-x64-msvc": "1.0.5"
95
95
  }
96
96
  }