@nuxt/webpack-builder 3.8.1 β†’ 3.9.0

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.
Files changed (3) hide show
  1. package/README.md +33 -2
  2. package/dist/index.mjs +21 -24
  3. package/package.json +27 -22
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
- - Extensible with [100+ modules](https://nuxt.com/modules)
21
- - Deployment to a variety of hosting platforms
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
@@ -239,28 +239,27 @@ class ScopedVarsCollector {
239
239
  }
240
240
  const NUXT_IMPORT_RE = /nuxt|#app|#imports/;
241
241
  function detectImportNames(code, composableMeta) {
242
- const imports = findStaticImports(code);
243
242
  const names = /* @__PURE__ */ new Set();
244
- for (const i of imports) {
245
- let addName = function(name) {
246
- const source = composableMeta[name]?.source;
247
- if (source && matchWithStringOrRegex(i.specifier, source)) {
248
- return;
249
- }
250
- names.add(name);
251
- };
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)) {
252
251
  if (NUXT_IMPORT_RE.test(i.specifier)) {
253
252
  continue;
254
253
  }
255
254
  const { namedImports, defaultImport, namespacedImport } = parseStaticImport(i);
256
255
  for (const name in namedImports || {}) {
257
- addName(namedImports[name]);
256
+ addName(namedImports[name], i.specifier);
258
257
  }
259
258
  if (defaultImport) {
260
- addName(defaultImport);
259
+ addName(defaultImport, i.specifier);
261
260
  }
262
261
  if (namespacedImport) {
263
- addName(namespacedImport);
262
+ addName(namespacedImport, i.specifier);
264
263
  }
265
264
  }
266
265
  return names;
@@ -344,6 +343,10 @@ function registerVirtualModules() {
344
343
  }));
345
344
  }
346
345
 
346
+ function toArray(value) {
347
+ return Array.isArray(value) ? value : [value];
348
+ }
349
+
347
350
  function createWebpackConfigContext(nuxt) {
348
351
  return {
349
352
  nuxt,
@@ -359,10 +362,7 @@ function createWebpackConfigContext(nuxt) {
359
362
  };
360
363
  }
361
364
  function applyPresets(ctx, presets) {
362
- if (!Array.isArray(presets)) {
363
- presets = [presets];
364
- }
365
- for (const preset of presets) {
365
+ for (const preset of toArray(presets)) {
366
366
  if (Array.isArray(preset)) {
367
367
  preset[0](ctx, preset[1]);
368
368
  } else {
@@ -599,8 +599,8 @@ function getEnv(ctx) {
599
599
  const _env = {
600
600
  "process.env.NODE_ENV": JSON.stringify(ctx.config.mode),
601
601
  __NUXT_VERSION__: JSON.stringify(ctx.nuxt._version),
602
+ __NUXT_ASYNC_CONTEXT__: ctx.options.experimental.asyncContext,
602
603
  "process.env.VUE_ENV": JSON.stringify(ctx.name),
603
- "process.env.NUXT_ASYNC_CONTEXT": ctx.options.experimental.asyncContext,
604
604
  "process.dev": ctx.options.dev,
605
605
  "process.test": isTest,
606
606
  "process.browser": ctx.isClient,
@@ -1035,10 +1035,7 @@ function vue(ctx) {
1035
1035
  ctx.config.module.rules.push({
1036
1036
  test: /\.vue$/i,
1037
1037
  loader: "vue-loader",
1038
- options: {
1039
- reactivityTransform: ctx.nuxt.options.experimental.reactivityTransform,
1040
- ...ctx.userConfig.loaders.vue
1041
- }
1038
+ options: ctx.userConfig.loaders.vue
1042
1039
  });
1043
1040
  if (ctx.isClient) {
1044
1041
  ctx.config.plugins.push(new VueSSRClientPlugin({
@@ -1124,7 +1121,7 @@ function clientHMR(ctx) {
1124
1121
  function clientOptimization(_ctx) {
1125
1122
  }
1126
1123
  function clientPlugins(ctx) {
1127
- if (!ctx.isDev && ctx.name === "client" && ctx.userConfig.analyze && (ctx.userConfig.analyze === true || ctx.userConfig.analyze.enabled)) {
1124
+ if (!ctx.isDev && !ctx.nuxt.options.test && ctx.name === "client" && ctx.userConfig.analyze && (ctx.userConfig.analyze === true || ctx.userConfig.analyze.enabled)) {
1128
1125
  const statsDir = resolve(ctx.options.analyzeDir);
1129
1126
  ctx.config.plugins.push(new BundleAnalyzerPlugin({
1130
1127
  analyzerMode: "static",
@@ -1137,7 +1134,7 @@ function clientPlugins(ctx) {
1137
1134
  }));
1138
1135
  }
1139
1136
  if (!ctx.nuxt.options.ssr) {
1140
- if (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev) {
1137
+ if (!ctx.nuxt.options.test && (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev)) {
1141
1138
  ctx.config.plugins.push(new ForkTSCheckerWebpackPlugin({
1142
1139
  logger
1143
1140
  }));
@@ -1240,7 +1237,7 @@ function serverPlugins(ctx) {
1240
1237
  URLSearchParams: [ctx.userConfig.serverURLPolyfill, "URLSearchParams"]
1241
1238
  }));
1242
1239
  }
1243
- if (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev) {
1240
+ if (!ctx.nuxt.options.test && (ctx.nuxt.options.typescript.typeCheck === true || ctx.nuxt.options.typescript.typeCheck === "build" && !ctx.nuxt.options.dev)) {
1244
1241
  ctx.config.plugins.push(new ForkTSCheckerWebpackPlugin({
1245
1242
  logger
1246
1243
  }));
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder",
3
- "version": "3.8.1",
4
- "repository": "nuxt/nuxt",
3
+ "version": "3.9.0",
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",
@@ -17,19 +22,19 @@
17
22
  "dist"
18
23
  ],
19
24
  "dependencies": {
20
- "@nuxt/friendly-errors-webpack-plugin": "^2.5.2",
25
+ "@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
21
26
  "autoprefixer": "^10.4.16",
22
27
  "css-loader": "^6.8.1",
23
28
  "css-minimizer-webpack-plugin": "^5.0.1",
24
- "cssnano": "^6.0.1",
29
+ "cssnano": "^6.0.2",
25
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
35
  "fork-ts-checker-webpack-plugin": "^9.0.2",
31
- "fs-extra": "^11.1.1",
32
- "h3": "^1.8.2",
36
+ "fs-extra": "^11.2.0",
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",
@@ -39,37 +44,37 @@
39
44
  "ohash": "^1.1.3",
40
45
  "pathe": "^1.1.1",
41
46
  "pify": "^6.1.0",
42
- "postcss": "^8.4.31",
47
+ "postcss": "^8.4.32",
43
48
  "postcss-import": "^15.1.0",
44
49
  "postcss-import-resolver": "^2.0.0",
45
50
  "postcss-loader": "^7.3.3",
46
51
  "postcss-url": "^10.1.3",
47
52
  "pug-plain-loader": "^1.1.0",
48
- "std-env": "^3.4.3",
53
+ "std-env": "^3.7.0",
49
54
  "time-fix-plugin": "^2.0.7",
50
- "ufo": "^1.3.1",
51
- "unplugin": "^1.5.0",
55
+ "ufo": "^1.3.2",
56
+ "unplugin": "^1.5.1",
52
57
  "url-loader": "^4.1.1",
53
58
  "vue-bundle-renderer": "^2.0.0",
54
- "vue-loader": "^17.3.1",
59
+ "vue-loader": "^17.4.0",
55
60
  "webpack": "^5.89.0",
56
- "webpack-bundle-analyzer": "^4.9.1",
61
+ "webpack-bundle-analyzer": "^4.10.1",
57
62
  "webpack-dev-middleware": "^6.1.1",
58
63
  "webpack-hot-middleware": "^2.25.4",
59
- "webpack-virtual-modules": "^0.6.0",
60
- "webpackbar": "^5.0.2",
61
- "@nuxt/kit": "3.8.1"
64
+ "webpack-virtual-modules": "^0.6.1",
65
+ "webpackbar": "^6.0.0",
66
+ "@nuxt/kit": "3.9.0"
62
67
  },
63
68
  "devDependencies": {
64
- "@types/fs-extra": "11.0.3",
65
- "@types/hash-sum": "1.0.1",
66
- "@types/pify": "5.0.3",
67
- "@types/webpack-bundle-analyzer": "4.6.2",
68
- "@types/webpack-hot-middleware": "2.25.8",
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",
69
74
  "@types/webpack-virtual-modules": "0.1.3",
70
75
  "unbuild": "latest",
71
- "vue": "3.3.8",
72
- "@nuxt/schema": "3.8.1"
76
+ "vue": "3.3.13",
77
+ "@nuxt/schema": "3.9.0"
73
78
  },
74
79
  "peerDependencies": {
75
80
  "vue": "^3.3.4"