@umijs/bundler-utoopack 4.6.4 → 4.6.6
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/dist/config.js +0 -31
- package/dist/index.js +2 -1
- package/package.json +4 -4
package/dist/config.js
CHANGED
|
@@ -27,27 +27,6 @@ var import_bundler_webpack = require("@umijs/bundler-webpack");
|
|
|
27
27
|
var import_utils = require("@umijs/utils");
|
|
28
28
|
var import_pack = require("@utoo/pack");
|
|
29
29
|
var import_path = require("path");
|
|
30
|
-
function convertProcessEnvForUtoopack(webpackConfig) {
|
|
31
|
-
var _a;
|
|
32
|
-
let processEnvForUtoopack = {};
|
|
33
|
-
if (webpackConfig.plugins) {
|
|
34
|
-
const definePlugin = webpackConfig.plugins.find(
|
|
35
|
-
(plugin) => plugin.constructor.name === "DefinePlugin"
|
|
36
|
-
);
|
|
37
|
-
if ((_a = definePlugin == null ? void 0 : definePlugin.definitions) == null ? void 0 : _a["process.env"]) {
|
|
38
|
-
for (const [key, value] of Object.entries(
|
|
39
|
-
definePlugin.definitions["process.env"]
|
|
40
|
-
)) {
|
|
41
|
-
if (typeof value === "string" && value.startsWith('"') && value.endsWith('"')) {
|
|
42
|
-
processEnvForUtoopack[key] = JSON.parse(value);
|
|
43
|
-
} else {
|
|
44
|
-
processEnvForUtoopack[key] = value;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return processEnvForUtoopack;
|
|
50
|
-
}
|
|
51
30
|
function getModularizeImports(extraBabelPlugins) {
|
|
52
31
|
return extraBabelPlugins.filter((p) => /^import$|babel-plugin-import/.test(p[0])).reduce(
|
|
53
32
|
(acc, [_, v]) => {
|
|
@@ -154,7 +133,6 @@ async function getProdUtooPackConfig(opts) {
|
|
|
154
133
|
...opts.config.extraBabelPlugins || []
|
|
155
134
|
];
|
|
156
135
|
const modularizeImports = getModularizeImports(extraBabelPlugins);
|
|
157
|
-
const processEnvForUtoopack = convertProcessEnvForUtoopack(webpackConfig);
|
|
158
136
|
const {
|
|
159
137
|
publicPath,
|
|
160
138
|
runtimePublicPath,
|
|
@@ -189,10 +167,6 @@ async function getProdUtooPackConfig(opts) {
|
|
|
189
167
|
},
|
|
190
168
|
sass: opts.config.sassLoader ?? void 0
|
|
191
169
|
},
|
|
192
|
-
// Override process.env for utoopack format
|
|
193
|
-
define: {
|
|
194
|
-
"process.env": JSON.stringify(processEnvForUtoopack)
|
|
195
|
-
},
|
|
196
170
|
nodePolyfill: true,
|
|
197
171
|
externals: getNormalizedExternals(userExternals)
|
|
198
172
|
},
|
|
@@ -234,7 +208,6 @@ async function getDevUtooPackConfig(opts) {
|
|
|
234
208
|
...opts.config.extraBabelPlugins || []
|
|
235
209
|
];
|
|
236
210
|
const modularizeImports = getModularizeImports(extraBabelPlugins);
|
|
237
|
-
const processEnvForUtoopack = convertProcessEnvForUtoopack(webpackConfig);
|
|
238
211
|
const {
|
|
239
212
|
publicPath,
|
|
240
213
|
runtimePublicPath,
|
|
@@ -269,10 +242,6 @@ async function getDevUtooPackConfig(opts) {
|
|
|
269
242
|
},
|
|
270
243
|
sass: opts.config.sassLoader ?? void 0
|
|
271
244
|
},
|
|
272
|
-
// Override process.env for utoopack format
|
|
273
|
-
define: {
|
|
274
|
-
"process.env": JSON.stringify(processEnvForUtoopack)
|
|
275
|
-
},
|
|
276
245
|
nodePolyfill: true,
|
|
277
246
|
externals: getNormalizedExternals(userExternals)
|
|
278
247
|
},
|
package/dist/index.js
CHANGED
|
@@ -203,7 +203,8 @@ async function dev(opts) {
|
|
|
203
203
|
};
|
|
204
204
|
try {
|
|
205
205
|
await utooPackServe(utooPackConfig, cwd, rootDir, {
|
|
206
|
-
port: utooServePort
|
|
206
|
+
port: utooServePort,
|
|
207
|
+
hostname: "127.0.0.1"
|
|
207
208
|
});
|
|
208
209
|
const stats = createStatsObject();
|
|
209
210
|
await (onDevCompileDone == null ? void 0 : onDevCompileDone({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-utoopack",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.6",
|
|
4
4
|
"description": "@umijs/bundler-utoopack",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@utoo/pack": "1.0.
|
|
11
|
+
"@utoo/pack": "1.0.6",
|
|
12
12
|
"compression": "^1.7.4",
|
|
13
13
|
"connect-history-api-fallback": "^2.0.0",
|
|
14
14
|
"cors": "^2.8.5",
|
|
15
15
|
"express": "^4.18.2",
|
|
16
16
|
"express-http-proxy": "^2.1.1",
|
|
17
|
-
"@umijs/bundler-utils": "4.6.
|
|
18
|
-
"@umijs/bundler-webpack": "4.6.
|
|
17
|
+
"@umijs/bundler-utils": "4.6.6",
|
|
18
|
+
"@umijs/bundler-webpack": "4.6.6"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"father": "4.1.5"
|