@nuxt/webpack-builder 3.8.0 β 3.8.2
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 +33 -2
- package/dist/index.mjs +30 -16
- package/package.json +25 -19
package/README.md
CHANGED
|
@@ -17,8 +17,9 @@ It provides a number of features that make it easy to build fast, SEO-friendly,
|
|
|
17
17
|
- Automatic routing with code-splitting
|
|
18
18
|
- State management
|
|
19
19
|
- SEO Optimization
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- Auto imports
|
|
21
|
+
- Extensible with [180+ modules](https://nuxt.com/modules)
|
|
22
|
+
- Deployment to a variety of [hosting platforms](https://nuxt.com/deploy)
|
|
22
23
|
- ...[and much more](https://nuxt.com) π
|
|
23
24
|
|
|
24
25
|
## Getting Started
|
|
@@ -31,6 +32,36 @@ npx nuxi@latest init <my-project>
|
|
|
31
32
|
|
|
32
33
|
Discover also [nuxt.new](https://nuxt.new): Open a Nuxt starter on CodeSandbox, StackBlitz or locally to get up and running in a few seconds.
|
|
33
34
|
|
|
35
|
+
## Vue Development
|
|
36
|
+
|
|
37
|
+
Simple, intuitive and powerful, Nuxt lets you write Vue components in a way that makes sense. Every repetitive task is automated, so you can focus on writing your full-stack Vue application with confidence.
|
|
38
|
+
|
|
39
|
+
Example of an `app.vue`:
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<script setup>
|
|
43
|
+
useSeoMeta({
|
|
44
|
+
title: 'Meet Nuxt',
|
|
45
|
+
description: 'The Intuitive Vue Framework.'
|
|
46
|
+
})
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<div id="app">
|
|
51
|
+
<AppHeader />
|
|
52
|
+
<NuxtPage />
|
|
53
|
+
<AppFooter />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<style>
|
|
58
|
+
#app {
|
|
59
|
+
background-color: #020420;
|
|
60
|
+
color: #00DC82;
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
63
|
+
```
|
|
64
|
+
|
|
34
65
|
## Documentation
|
|
35
66
|
|
|
36
67
|
We highly recommend you take a look at the [Nuxt documentation](https://nuxt.com/docs) to level up. Itβs a great resource for learning more about the framework. It covers everything from getting started to advanced topics.
|
package/dist/index.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import VirtualModulesPlugin from 'webpack-virtual-modules';
|
|
|
19
19
|
import querystring from 'node:querystring';
|
|
20
20
|
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
|
|
21
21
|
import ForkTSCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
|
22
|
-
import {
|
|
22
|
+
import { cloneDeep } from 'lodash-es';
|
|
23
23
|
import TimeFixPlugin from 'time-fix-plugin';
|
|
24
24
|
import WebpackBar from 'webpackbar';
|
|
25
25
|
import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
|
|
@@ -27,6 +27,7 @@ import { isTest } from 'std-env';
|
|
|
27
27
|
import { EsbuildPlugin } from 'esbuild-loader';
|
|
28
28
|
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
29
29
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
|
30
|
+
import createResolver from 'postcss-import-resolver';
|
|
30
31
|
import VueLoaderPlugin from 'vue-loader/dist/pluginWebpack5.js';
|
|
31
32
|
import { normalizeWebpackManifest } from 'vue-bundle-renderer';
|
|
32
33
|
import hash$1 from 'hash-sum';
|
|
@@ -238,28 +239,27 @@ class ScopedVarsCollector {
|
|
|
238
239
|
}
|
|
239
240
|
const NUXT_IMPORT_RE = /nuxt|#app|#imports/;
|
|
240
241
|
function detectImportNames(code, composableMeta) {
|
|
241
|
-
const imports = findStaticImports(code);
|
|
242
242
|
const names = /* @__PURE__ */ new Set();
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
243
|
+
function addName(name, specifier) {
|
|
244
|
+
const source = composableMeta[name]?.source;
|
|
245
|
+
if (source && matchWithStringOrRegex(specifier, source)) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
names.add(name);
|
|
249
|
+
}
|
|
250
|
+
for (const i of findStaticImports(code)) {
|
|
251
251
|
if (NUXT_IMPORT_RE.test(i.specifier)) {
|
|
252
252
|
continue;
|
|
253
253
|
}
|
|
254
254
|
const { namedImports, defaultImport, namespacedImport } = parseStaticImport(i);
|
|
255
255
|
for (const name in namedImports || {}) {
|
|
256
|
-
addName(namedImports[name]);
|
|
256
|
+
addName(namedImports[name], i.specifier);
|
|
257
257
|
}
|
|
258
258
|
if (defaultImport) {
|
|
259
|
-
addName(defaultImport);
|
|
259
|
+
addName(defaultImport, i.specifier);
|
|
260
260
|
}
|
|
261
261
|
if (namespacedImport) {
|
|
262
|
-
addName(namespacedImport);
|
|
262
|
+
addName(namespacedImport, i.specifier);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
return names;
|
|
@@ -383,7 +383,7 @@ function fileName(ctx, key) {
|
|
|
383
383
|
return fileName2;
|
|
384
384
|
}
|
|
385
385
|
function getWebpackConfig(ctx) {
|
|
386
|
-
return
|
|
386
|
+
return cloneDeep(ctx.config);
|
|
387
387
|
}
|
|
388
388
|
|
|
389
389
|
function assets(ctx) {
|
|
@@ -714,6 +714,21 @@ const getPostcssConfig = (nuxt) => {
|
|
|
714
714
|
return false;
|
|
715
715
|
}
|
|
716
716
|
const postcssOptions = defu({}, nuxt.options.postcss, {
|
|
717
|
+
plugins: {
|
|
718
|
+
/**
|
|
719
|
+
* https://github.com/postcss/postcss-import
|
|
720
|
+
*/
|
|
721
|
+
"postcss-import": {
|
|
722
|
+
resolve: createResolver({
|
|
723
|
+
alias: { ...nuxt.options.alias },
|
|
724
|
+
modules: nuxt.options.modulesDir
|
|
725
|
+
})
|
|
726
|
+
},
|
|
727
|
+
/**
|
|
728
|
+
* https://github.com/postcss/postcss-url
|
|
729
|
+
*/
|
|
730
|
+
"postcss-url": {}
|
|
731
|
+
},
|
|
717
732
|
sourceMap: nuxt.options.webpack.cssSourceMap,
|
|
718
733
|
// Array, String or Function
|
|
719
734
|
order: "autoprefixerAndCssnanoLast"
|
|
@@ -1108,7 +1123,7 @@ function clientHMR(ctx) {
|
|
|
1108
1123
|
function clientOptimization(_ctx) {
|
|
1109
1124
|
}
|
|
1110
1125
|
function clientPlugins(ctx) {
|
|
1111
|
-
if (!ctx.isDev && ctx.name === "client" && ctx.userConfig.analyze) {
|
|
1126
|
+
if (!ctx.isDev && ctx.name === "client" && ctx.userConfig.analyze && (ctx.userConfig.analyze === true || ctx.userConfig.analyze.enabled)) {
|
|
1112
1127
|
const statsDir = resolve(ctx.options.analyzeDir);
|
|
1113
1128
|
ctx.config.plugins.push(new BundleAnalyzerPlugin({
|
|
1114
1129
|
analyzerMode: "static",
|
|
@@ -1171,7 +1186,6 @@ function server(ctx) {
|
|
|
1171
1186
|
serverPreset,
|
|
1172
1187
|
serverPlugins
|
|
1173
1188
|
]);
|
|
1174
|
-
return getWebpackConfig(ctx);
|
|
1175
1189
|
}
|
|
1176
1190
|
function serverPreset(ctx) {
|
|
1177
1191
|
ctx.config.output.filename = "server.mjs";
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/webpack-builder",
|
|
3
|
-
"version": "3.8.
|
|
4
|
-
"repository":
|
|
3
|
+
"version": "3.8.2",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "git+https://github.com/nuxt/nuxt.git",
|
|
7
|
+
"directory": "packages/webpack"
|
|
8
|
+
},
|
|
5
9
|
"description": "Webpack bundler for Nuxt",
|
|
10
|
+
"homepage": "https://nuxt.com",
|
|
6
11
|
"license": "MIT",
|
|
7
12
|
"type": "module",
|
|
8
13
|
"types": "./dist/index.d.ts",
|
|
@@ -22,16 +27,16 @@
|
|
|
22
27
|
"css-loader": "^6.8.1",
|
|
23
28
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
24
29
|
"cssnano": "^6.0.1",
|
|
25
|
-
"defu": "^6.1.
|
|
30
|
+
"defu": "^6.1.3",
|
|
26
31
|
"esbuild-loader": "^4.0.2",
|
|
27
32
|
"escape-string-regexp": "^5.0.0",
|
|
28
33
|
"estree-walker": "^3.0.3",
|
|
29
34
|
"file-loader": "^6.2.0",
|
|
30
|
-
"fork-ts-checker-webpack-plugin": "^9.0.
|
|
35
|
+
"fork-ts-checker-webpack-plugin": "^9.0.2",
|
|
31
36
|
"fs-extra": "^11.1.1",
|
|
32
|
-
"h3": "^1.
|
|
37
|
+
"h3": "^1.9.0",
|
|
33
38
|
"hash-sum": "^2.0.0",
|
|
34
|
-
"
|
|
39
|
+
"lodash-es": "4.17.21",
|
|
35
40
|
"magic-string": "^0.30.5",
|
|
36
41
|
"memfs": "^4.6.0",
|
|
37
42
|
"mini-css-extract-plugin": "^2.7.6",
|
|
@@ -41,34 +46,35 @@
|
|
|
41
46
|
"pify": "^6.1.0",
|
|
42
47
|
"postcss": "^8.4.31",
|
|
43
48
|
"postcss-import": "^15.1.0",
|
|
49
|
+
"postcss-import-resolver": "^2.0.0",
|
|
44
50
|
"postcss-loader": "^7.3.3",
|
|
45
51
|
"postcss-url": "^10.1.3",
|
|
46
52
|
"pug-plain-loader": "^1.1.0",
|
|
47
|
-
"std-env": "^3.
|
|
53
|
+
"std-env": "^3.5.0",
|
|
48
54
|
"time-fix-plugin": "^2.0.7",
|
|
49
|
-
"ufo": "^1.3.
|
|
50
|
-
"unplugin": "^1.5.
|
|
55
|
+
"ufo": "^1.3.2",
|
|
56
|
+
"unplugin": "^1.5.1",
|
|
51
57
|
"url-loader": "^4.1.1",
|
|
52
58
|
"vue-bundle-renderer": "^2.0.0",
|
|
53
|
-
"vue-loader": "^17.3.
|
|
59
|
+
"vue-loader": "^17.3.1",
|
|
54
60
|
"webpack": "^5.89.0",
|
|
55
|
-
"webpack-bundle-analyzer": "^4.
|
|
61
|
+
"webpack-bundle-analyzer": "^4.10.1",
|
|
56
62
|
"webpack-dev-middleware": "^6.1.1",
|
|
57
63
|
"webpack-hot-middleware": "^2.25.4",
|
|
58
64
|
"webpack-virtual-modules": "^0.6.0",
|
|
59
65
|
"webpackbar": "^5.0.2",
|
|
60
|
-
"@nuxt/kit": "3.8.
|
|
66
|
+
"@nuxt/kit": "3.8.2"
|
|
61
67
|
},
|
|
62
68
|
"devDependencies": {
|
|
63
|
-
"@types/fs-extra": "11.0.
|
|
64
|
-
"@types/hash-sum": "1.0.
|
|
65
|
-
"@types/pify": "5.0.
|
|
66
|
-
"@types/webpack-bundle-analyzer": "4.6.
|
|
67
|
-
"@types/webpack-hot-middleware": "2.25.
|
|
69
|
+
"@types/fs-extra": "11.0.4",
|
|
70
|
+
"@types/hash-sum": "1.0.2",
|
|
71
|
+
"@types/pify": "5.0.4",
|
|
72
|
+
"@types/webpack-bundle-analyzer": "4.6.3",
|
|
73
|
+
"@types/webpack-hot-middleware": "2.25.9",
|
|
68
74
|
"@types/webpack-virtual-modules": "0.1.3",
|
|
69
75
|
"unbuild": "latest",
|
|
70
|
-
"vue": "3.3.
|
|
71
|
-
"@nuxt/schema": "3.8.
|
|
76
|
+
"vue": "3.3.8",
|
|
77
|
+
"@nuxt/schema": "3.8.2"
|
|
72
78
|
},
|
|
73
79
|
"peerDependencies": {
|
|
74
80
|
"vue": "^3.3.4"
|