@nuxt/webpack-builder 3.14.0 → 3.14.1592
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/builder.mjs +1 -0
- package/dist/index.mjs +40 -10
- package/package.json +11 -11
package/builder.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import MagicString from 'magic-string';
|
|
|
13
13
|
import { hash } from 'ohash';
|
|
14
14
|
import escapeRE from 'escape-string-regexp';
|
|
15
15
|
import { findStaticImports, parseStaticImport } from 'mlly';
|
|
16
|
-
import { webpack, builder, MiniCssExtractPlugin } from '#builder';
|
|
16
|
+
import { webpack, WebpackBarPlugin, builder, MiniCssExtractPlugin } from '#builder';
|
|
17
17
|
import { createFsFromVolume, Volume } from 'memfs';
|
|
18
18
|
import querystring from 'node:querystring';
|
|
19
19
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
@@ -21,7 +21,6 @@ import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
|
21
21
|
import { env, nodeless } from 'unenv';
|
|
22
22
|
import { cloneDeep } from 'lodash-es';
|
|
23
23
|
import TimeFixPlugin from 'time-fix-plugin';
|
|
24
|
-
import WebpackBar from 'webpackbar';
|
|
25
24
|
import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
|
|
26
25
|
import { isTest } from 'std-env';
|
|
27
26
|
import { EsbuildPlugin } from 'esbuild-loader';
|
|
@@ -495,7 +494,7 @@ function basePlugins(ctx) {
|
|
|
495
494
|
server: "orange",
|
|
496
495
|
modern: "blue"
|
|
497
496
|
};
|
|
498
|
-
ctx.config.plugins.push(new
|
|
497
|
+
ctx.config.plugins.push(new WebpackBarPlugin({
|
|
499
498
|
name: ctx.name,
|
|
500
499
|
color: colors[ctx.name],
|
|
501
500
|
reporters: ["stats"],
|
|
@@ -508,18 +507,18 @@ function basePlugins(ctx) {
|
|
|
508
507
|
ctx.nuxt.callHook(`${builder}:change`, shortPath);
|
|
509
508
|
}
|
|
510
509
|
},
|
|
511
|
-
done: ({
|
|
512
|
-
if (
|
|
510
|
+
done: (_, { stats }) => {
|
|
511
|
+
if (stats.hasErrors()) {
|
|
513
512
|
ctx.nuxt.callHook(`${builder}:error`);
|
|
514
513
|
} else {
|
|
515
|
-
logger.success(
|
|
514
|
+
logger.success(`Finished building ${stats.compilation.name ?? "Nuxt app"}`);
|
|
516
515
|
}
|
|
517
516
|
},
|
|
518
517
|
allDone: () => {
|
|
519
518
|
ctx.nuxt.callHook(`${builder}:done`);
|
|
520
519
|
},
|
|
521
|
-
progress({
|
|
522
|
-
ctx.nuxt.callHook(`${builder}:progress`, statesArray);
|
|
520
|
+
progress: ({ webpackbar }) => {
|
|
521
|
+
ctx.nuxt.callHook(`${builder}:progress`, webpackbar.statesArray);
|
|
523
522
|
}
|
|
524
523
|
}
|
|
525
524
|
}
|
|
@@ -1335,14 +1334,45 @@ async function createDevMiddleware(compiler) {
|
|
|
1335
1334
|
path: joinURL(nuxt.options.app.baseURL, "__webpack_hmr", compiler.options.name),
|
|
1336
1335
|
...hotMiddlewareOptions
|
|
1337
1336
|
});
|
|
1338
|
-
const devHandler =
|
|
1337
|
+
const devHandler = wdmToH3Handler(devMiddleware);
|
|
1339
1338
|
const hotHandler = fromNodeMiddleware(hotMiddleware);
|
|
1340
1339
|
await nuxt.callHook("server:devHandler", defineEventHandler(async (event) => {
|
|
1341
|
-
await devHandler(event);
|
|
1340
|
+
const body = await devHandler(event);
|
|
1341
|
+
if (body !== void 0) {
|
|
1342
|
+
return body;
|
|
1343
|
+
}
|
|
1342
1344
|
await hotHandler(event);
|
|
1343
1345
|
}));
|
|
1344
1346
|
return devMiddleware;
|
|
1345
1347
|
}
|
|
1348
|
+
function wdmToH3Handler(devMiddleware) {
|
|
1349
|
+
return defineEventHandler(async (event) => {
|
|
1350
|
+
event.context.webpack = {
|
|
1351
|
+
...event.context.webpack,
|
|
1352
|
+
devMiddleware: devMiddleware.context
|
|
1353
|
+
};
|
|
1354
|
+
const { req, res } = event.node;
|
|
1355
|
+
const body = await new Promise((resolve, reject) => {
|
|
1356
|
+
res.stream = (stream) => {
|
|
1357
|
+
resolve(stream);
|
|
1358
|
+
};
|
|
1359
|
+
res.send = (data) => {
|
|
1360
|
+
resolve(data);
|
|
1361
|
+
};
|
|
1362
|
+
res.finish = (data) => {
|
|
1363
|
+
resolve(data);
|
|
1364
|
+
};
|
|
1365
|
+
devMiddleware(req, res, (err) => {
|
|
1366
|
+
if (err) {
|
|
1367
|
+
reject(err);
|
|
1368
|
+
} else {
|
|
1369
|
+
resolve(void 0);
|
|
1370
|
+
}
|
|
1371
|
+
});
|
|
1372
|
+
});
|
|
1373
|
+
return body;
|
|
1374
|
+
});
|
|
1375
|
+
}
|
|
1346
1376
|
async function compile(compiler) {
|
|
1347
1377
|
const nuxt = useNuxt();
|
|
1348
1378
|
await nuxt.callHook(`${builder}:compile`, { name: compiler.options.name, compiler });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/webpack-builder",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.1592",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -41,24 +41,24 @@
|
|
|
41
41
|
"hash-sum": "^2.0.0",
|
|
42
42
|
"jiti": "^2.4.0",
|
|
43
43
|
"lodash-es": "4.17.21",
|
|
44
|
-
"magic-string": "^0.30.
|
|
44
|
+
"magic-string": "^0.30.13",
|
|
45
45
|
"memfs": "^4.14.0",
|
|
46
46
|
"mini-css-extract-plugin": "^2.9.2",
|
|
47
|
-
"mlly": "^1.7.
|
|
47
|
+
"mlly": "^1.7.3",
|
|
48
48
|
"ohash": "^1.1.4",
|
|
49
49
|
"pathe": "^1.1.2",
|
|
50
50
|
"pify": "^6.1.0",
|
|
51
|
-
"postcss": "^8.4.
|
|
51
|
+
"postcss": "^8.4.49",
|
|
52
52
|
"postcss-import": "^16.1.0",
|
|
53
53
|
"postcss-import-resolver": "^2.0.0",
|
|
54
54
|
"postcss-loader": "^8.1.1",
|
|
55
55
|
"postcss-url": "^10.1.3",
|
|
56
56
|
"pug-plain-loader": "^1.1.0",
|
|
57
|
-
"std-env": "^3.
|
|
57
|
+
"std-env": "^3.8.0",
|
|
58
58
|
"time-fix-plugin": "^2.0.7",
|
|
59
59
|
"ufo": "^1.5.4",
|
|
60
60
|
"unenv": "^1.10.0",
|
|
61
|
-
"unplugin": "^1.
|
|
61
|
+
"unplugin": "^1.16.0",
|
|
62
62
|
"url-loader": "^4.1.1",
|
|
63
63
|
"vue-bundle-renderer": "^2.1.1",
|
|
64
64
|
"vue-loader": "^17.4.2",
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
67
67
|
"webpack-dev-middleware": "^7.4.2",
|
|
68
68
|
"webpack-hot-middleware": "^2.26.1",
|
|
69
|
-
"webpackbar": "^
|
|
70
|
-
"@nuxt/kit": "3.14.
|
|
69
|
+
"webpackbar": "^7.0.0",
|
|
70
|
+
"@nuxt/kit": "3.14.1592"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
|
-
"@rspack/core": "1.
|
|
73
|
+
"@rspack/core": "1.1.2",
|
|
74
74
|
"@types/hash-sum": "1.0.2",
|
|
75
75
|
"@types/lodash-es": "4.17.12",
|
|
76
76
|
"@types/pify": "5.0.4",
|
|
77
77
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
78
78
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
79
79
|
"unbuild": "latest",
|
|
80
|
-
"vue": "3.5.
|
|
81
|
-
"@nuxt/schema": "3.14.
|
|
80
|
+
"vue": "3.5.13",
|
|
81
|
+
"@nuxt/schema": "3.14.1592"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
84
84
|
"vue": "^3.3.4"
|