@nuxt/webpack-builder 3.12.1 → 3.12.3
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/README.md +4 -10
- package/dist/index.mjs +26 -27
- package/package.json +11 -14
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[](https://nuxt.com)
|
|
2
2
|
|
|
3
3
|
# Nuxt
|
|
4
4
|
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/v/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/nuxt"><img src="https://img.shields.io/npm/dm/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="Downloads"></a>
|
|
8
|
-
<a href="
|
|
8
|
+
<a href="https://github.com/nuxt/nuxt/tree/main/LICENSE"><img src="https://img.shields.io/github/license/nuxt/nuxt.svg?style=flat&colorA=18181B&colorB=28CF8D" alt="License"></a>
|
|
9
9
|
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt%20Docs-18181B?logo=nuxt.js" alt="Website"></a>
|
|
10
10
|
<a href="https://chat.nuxt.dev"><img src="https://img.shields.io/badge/Nuxt%20Discord-18181B?logo=discord" alt="Discord"></a>
|
|
11
11
|
</p>
|
|
@@ -101,12 +101,6 @@ Here are a few ways you can get involved:
|
|
|
101
101
|
|
|
102
102
|
Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/community/framework-contribution#setup) to contribute to the framework and documentation.
|
|
103
103
|
|
|
104
|
-
## <a name="nuxt-2">⛰️ Nuxt 2</a>
|
|
105
|
-
|
|
106
|
-
You can find the code for Nuxt 2 on the [`2.x` branch](https://github.com/nuxt/nuxt/tree/2.x) and the documentation at [v2.nuxt.com](https://v2.nuxt.com).
|
|
107
|
-
|
|
108
|
-
If you expect to be using Nuxt 2 beyond the EOL (End of Life) date (June 30, 2024), and still need a maintained version that can satisfy security and browser compatibility requirements, make sure to check out [HeroDevs’ NES (Never-Ending Support) Nuxt 2](https://www.herodevs.com/support/nuxt-nes?utm_source=nuxt-github&utm_medium=nuxt-readme).
|
|
109
|
-
|
|
110
104
|
## <a name="professional-support">🛟 Professional Support</a>
|
|
111
105
|
|
|
112
106
|
- Technical audit & consulting: [Nuxt Experts](https://nuxt.com/enterprise/support)
|
|
@@ -115,9 +109,9 @@ If you expect to be using Nuxt 2 beyond the EOL (End of Life) date (June 30, 202
|
|
|
115
109
|
## <a name="follow-us">🔗 Follow us</a>
|
|
116
110
|
|
|
117
111
|
<p valign="center">
|
|
118
|
-
<a href="https://chat.nuxt.dev"><img width="20px" src="
|
|
112
|
+
<a href="https://chat.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/discord.svg" alt="Discord"></a> <a href="https://twitter.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/twitter.svg" alt="Twitter"></a> <a href="https://github.nuxt.dev"><img width="20px" src="https://github.com/nuxt/nuxt/tree/main/.github/assets/github.svg" alt="GitHub"></a>
|
|
119
113
|
</p>
|
|
120
114
|
|
|
121
115
|
## <a name="license">⚖️ License</a>
|
|
122
116
|
|
|
123
|
-
[MIT](
|
|
117
|
+
[MIT](https://github.com/nuxt/nuxt/tree/main/LICENSE)
|
package/dist/index.mjs
CHANGED
|
@@ -6,14 +6,14 @@ import webpackHotMiddleware from 'webpack-hot-middleware';
|
|
|
6
6
|
import { defu } from 'defu';
|
|
7
7
|
import { parseURL, parseQuery, joinURL } from 'ufo';
|
|
8
8
|
import { useNuxt, logger, requireModule } from '@nuxt/kit';
|
|
9
|
-
import { pathToFileURL } from 'node:url';
|
|
9
|
+
import { pathToFileURL, fileURLToPath } from 'node:url';
|
|
10
10
|
import { createUnplugin } from 'unplugin';
|
|
11
11
|
import { isAbsolute, relative, join, resolve, normalize, dirname } from 'pathe';
|
|
12
12
|
import { walk } from 'estree-walker';
|
|
13
13
|
import MagicString from 'magic-string';
|
|
14
14
|
import { hash } from 'ohash';
|
|
15
15
|
import escapeRE from 'escape-string-regexp';
|
|
16
|
-
import { findStaticImports, parseStaticImport
|
|
16
|
+
import { findStaticImports, parseStaticImport } from 'mlly';
|
|
17
17
|
import { createFsFromVolume, Volume } from 'memfs';
|
|
18
18
|
import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
19
19
|
import querystring from 'node:querystring';
|
|
@@ -30,9 +30,9 @@ import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
|
30
30
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
31
31
|
import createResolver from 'postcss-import-resolver';
|
|
32
32
|
import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';
|
|
33
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
33
34
|
import { normalizeWebpackManifest } from 'vue-bundle-renderer';
|
|
34
35
|
import hash$1 from 'hash-sum';
|
|
35
|
-
import fse from 'fs-extra';
|
|
36
36
|
|
|
37
37
|
function matchWithStringOrRegex(value, matcher) {
|
|
38
38
|
if (typeof matcher === "string") {
|
|
@@ -54,11 +54,14 @@ const NUXT_LIB_RE = /node_modules\/(?:nuxt|nuxt3|nuxt-nightly)\//;
|
|
|
54
54
|
const SUPPORTED_EXT_RE = /\.(?:m?[jt]sx?|vue)/;
|
|
55
55
|
const composableKeysPlugin = createUnplugin((options) => {
|
|
56
56
|
const composableMeta = {};
|
|
57
|
+
const composableLengths = /* @__PURE__ */ new Set();
|
|
58
|
+
const keyedFunctions = /* @__PURE__ */ new Set();
|
|
57
59
|
for (const { name, ...meta } of options.composables) {
|
|
58
60
|
composableMeta[name] = meta;
|
|
61
|
+
keyedFunctions.add(name);
|
|
62
|
+
composableLengths.add(meta.argumentLength);
|
|
59
63
|
}
|
|
60
|
-
const maxLength = Math.max(...
|
|
61
|
-
const keyedFunctions = new Set(options.composables.map(({ name }) => name));
|
|
64
|
+
const maxLength = Math.max(...composableLengths);
|
|
62
65
|
const KEYED_FUNCTIONS_RE = new RegExp(`\\b(${[...keyedFunctions].map((f) => escapeRE(f)).join("|")})\\b`);
|
|
63
66
|
return {
|
|
64
67
|
name: "nuxt:composable-keys",
|
|
@@ -256,8 +259,8 @@ function detectImportNames(code, composableMeta) {
|
|
|
256
259
|
if (NUXT_IMPORT_RE.test(i.specifier)) {
|
|
257
260
|
continue;
|
|
258
261
|
}
|
|
259
|
-
const { namedImports, defaultImport, namespacedImport } = parseStaticImport(i);
|
|
260
|
-
for (const name in namedImports
|
|
262
|
+
const { namedImports = {}, defaultImport, namespacedImport } = parseStaticImport(i);
|
|
263
|
+
for (const name in namedImports) {
|
|
261
264
|
addName(namedImports[name], i.specifier);
|
|
262
265
|
}
|
|
263
266
|
if (defaultImport) {
|
|
@@ -738,9 +741,9 @@ const getPostcssConfig = (nuxt) => {
|
|
|
738
741
|
order: "autoprefixerAndCssnanoLast"
|
|
739
742
|
});
|
|
740
743
|
if (!Array.isArray(postcssOptions.plugins) && isPureObject(postcssOptions.plugins)) {
|
|
741
|
-
const
|
|
744
|
+
const cwd = fileURLToPath(new URL(".", import.meta.url));
|
|
742
745
|
postcssOptions.plugins = sortPlugins(postcssOptions).map((pluginName) => {
|
|
743
|
-
const pluginFn = requireModule(pluginName, { paths: [
|
|
746
|
+
const pluginFn = requireModule(pluginName, { paths: [cwd] });
|
|
744
747
|
const pluginOptions = postcssOptions.plugins[pluginName];
|
|
745
748
|
if (!pluginOptions || typeof pluginFn !== "function") {
|
|
746
749
|
return null;
|
|
@@ -899,24 +902,20 @@ class VueSSRClientPlugin {
|
|
|
899
902
|
}
|
|
900
903
|
const allFiles = /* @__PURE__ */ new Set();
|
|
901
904
|
const asyncFiles = /* @__PURE__ */ new Set();
|
|
902
|
-
for (const asset of stats.assets) {
|
|
903
|
-
const file = asset.name;
|
|
904
|
-
if (!isHotUpdate(file)) {
|
|
905
|
-
allFiles.add(file);
|
|
906
|
-
if (initialFiles.has(file)) {
|
|
907
|
-
continue;
|
|
908
|
-
}
|
|
909
|
-
if (isJS(file) || isCSS(file)) {
|
|
910
|
-
asyncFiles.add(file);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
905
|
const assetsMapping = {};
|
|
915
|
-
for (const { name, chunkNames = [] } of stats.assets) {
|
|
916
|
-
if (
|
|
906
|
+
for (const { name: file, chunkNames = [] } of stats.assets) {
|
|
907
|
+
if (isHotUpdate(file)) {
|
|
908
|
+
continue;
|
|
909
|
+
}
|
|
910
|
+
allFiles.add(file);
|
|
911
|
+
const isFileJS = isJS(file);
|
|
912
|
+
if (!initialFiles.has(file) && (isFileJS || isCSS(file))) {
|
|
913
|
+
asyncFiles.add(file);
|
|
914
|
+
}
|
|
915
|
+
if (isFileJS) {
|
|
917
916
|
const componentHash = hash$1(chunkNames.join("|"));
|
|
918
917
|
const map = assetsMapping[componentHash] || (assetsMapping[componentHash] = []);
|
|
919
|
-
map.push(
|
|
918
|
+
map.push(file);
|
|
920
919
|
}
|
|
921
920
|
}
|
|
922
921
|
const webpackManifest = {
|
|
@@ -971,10 +970,10 @@ class VueSSRClientPlugin {
|
|
|
971
970
|
const manifest = normalizeWebpackManifest(webpackManifest);
|
|
972
971
|
await this.options.nuxt.callHook("build:manifest", manifest);
|
|
973
972
|
const src = JSON.stringify(manifest, null, 2);
|
|
974
|
-
await
|
|
975
|
-
await
|
|
973
|
+
await mkdir(dirname(this.options.filename), { recursive: true });
|
|
974
|
+
await writeFile(this.options.filename, src);
|
|
976
975
|
const mjsSrc = "export default " + src;
|
|
977
|
-
await
|
|
976
|
+
await writeFile(this.options.filename.replace(".json", ".mjs"), mjsSrc);
|
|
978
977
|
});
|
|
979
978
|
}
|
|
980
979
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/webpack-builder",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
@@ -26,25 +26,24 @@
|
|
|
26
26
|
"autoprefixer": "^10.4.19",
|
|
27
27
|
"css-loader": "^7.1.2",
|
|
28
28
|
"css-minimizer-webpack-plugin": "^7.0.0",
|
|
29
|
-
"cssnano": "^7.0.
|
|
29
|
+
"cssnano": "^7.0.3",
|
|
30
30
|
"defu": "^6.1.4",
|
|
31
|
-
"esbuild-loader": "^4.
|
|
31
|
+
"esbuild-loader": "^4.2.0",
|
|
32
32
|
"escape-string-regexp": "^5.0.0",
|
|
33
33
|
"estree-walker": "^3.0.3",
|
|
34
34
|
"file-loader": "^6.2.0",
|
|
35
35
|
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
36
|
-
"
|
|
37
|
-
"h3": "^1.11.1",
|
|
36
|
+
"h3": "^1.12.0",
|
|
38
37
|
"hash-sum": "^2.0.0",
|
|
39
38
|
"lodash-es": "4.17.21",
|
|
40
39
|
"magic-string": "^0.30.10",
|
|
41
|
-
"memfs": "^4.9.
|
|
40
|
+
"memfs": "^4.9.3",
|
|
42
41
|
"mini-css-extract-plugin": "^2.9.0",
|
|
43
42
|
"mlly": "^1.7.1",
|
|
44
43
|
"ohash": "^1.1.3",
|
|
45
44
|
"pathe": "^1.1.2",
|
|
46
45
|
"pify": "^6.1.0",
|
|
47
|
-
"postcss": "^8.4.
|
|
46
|
+
"postcss": "^8.4.39",
|
|
48
47
|
"postcss-import": "^16.1.0",
|
|
49
48
|
"postcss-import-resolver": "^2.0.0",
|
|
50
49
|
"postcss-loader": "^8.1.1",
|
|
@@ -54,29 +53,27 @@
|
|
|
54
53
|
"time-fix-plugin": "^2.0.7",
|
|
55
54
|
"ufo": "^1.5.3",
|
|
56
55
|
"unenv": "^1.9.0",
|
|
57
|
-
"unplugin": "^1.
|
|
56
|
+
"unplugin": "^1.11.0",
|
|
58
57
|
"url-loader": "^4.1.1",
|
|
59
58
|
"vue-bundle-renderer": "^2.1.0",
|
|
60
59
|
"vue-loader": "^17.4.2",
|
|
61
|
-
"webpack": "^5.
|
|
60
|
+
"webpack": "^5.92.1",
|
|
62
61
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
63
62
|
"webpack-dev-middleware": "^7.2.1",
|
|
64
63
|
"webpack-hot-middleware": "^2.26.1",
|
|
65
64
|
"webpack-virtual-modules": "^0.6.2",
|
|
66
65
|
"webpackbar": "^6.0.1",
|
|
67
|
-
"@nuxt/kit": "3.12.
|
|
66
|
+
"@nuxt/kit": "3.12.3"
|
|
68
67
|
},
|
|
69
68
|
"devDependencies": {
|
|
70
|
-
"@types/fs-extra": "11.0.4",
|
|
71
69
|
"@types/hash-sum": "1.0.2",
|
|
72
70
|
"@types/lodash-es": "4.17.12",
|
|
73
71
|
"@types/pify": "5.0.4",
|
|
74
72
|
"@types/webpack-bundle-analyzer": "4.7.0",
|
|
75
73
|
"@types/webpack-hot-middleware": "2.25.9",
|
|
76
|
-
"@types/webpack-virtual-modules": "0.4.2",
|
|
77
74
|
"unbuild": "latest",
|
|
78
|
-
"vue": "3.4.
|
|
79
|
-
"@nuxt/schema": "3.12.
|
|
75
|
+
"vue": "3.4.31",
|
|
76
|
+
"@nuxt/schema": "3.12.3"
|
|
80
77
|
},
|
|
81
78
|
"peerDependencies": {
|
|
82
79
|
"vue": "^3.3.4"
|