@nuxt/webpack-builder 3.7.3 → 3.8.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 +2 -2
  2. package/dist/index.mjs +23 -34
  3. package/package.json +22 -22
package/README.md CHANGED
@@ -17,7 +17,7 @@ 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
- - Extandable with [100+ modules](https://nuxt.com/modules)
20
+ - Extensible with [100+ modules](https://nuxt.com/modules)
21
21
  - Deployment to a variety of hosting platforms
22
22
  - ...[and much more](https://nuxt.com) 🚀
23
23
 
@@ -50,7 +50,7 @@ Here are a few ways you can get involved:
50
50
 
51
51
  ## Local Development
52
52
 
53
- Follow the docs to [Set Up Your Local Development Environment](https://nuxt.com/docs/community/framework-contribution#set-up-your-local-development-environment) to contribute to the framework and documentation.
53
+ 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.
54
54
 
55
55
  ## Nuxt 2
56
56
 
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 { cloneDeep, defaults as defaults$1, merge, uniq } from 'lodash-es';
22
+ import { klona } from 'klona';
23
23
  import TimeFixPlugin from 'time-fix-plugin';
24
24
  import WebpackBar from 'webpackbar';
25
25
  import FriendlyErrorsWebpackPlugin from '@nuxt/friendly-errors-webpack-plugin';
@@ -48,7 +48,7 @@ var __publicField$3 = (obj, key, value) => {
48
48
  return value;
49
49
  };
50
50
  const stringTypes = ["Literal", "TemplateLiteral"];
51
- const NUXT_LIB_RE = /node_modules\/nuxt3?\//;
51
+ const NUXT_LIB_RE = /node_modules\/(nuxt|nuxt3|nuxt-nightly)\//;
52
52
  const SUPPORTED_EXT_RE = /\.(m?[jt]sx?|vue)/;
53
53
  const composableKeysPlugin = createUnplugin((options) => {
54
54
  const composableMeta = Object.fromEntries(options.composables.map(({ name, ...meta }) => [name, meta]));
@@ -383,7 +383,7 @@ function fileName(ctx, key) {
383
383
  return fileName2;
384
384
  }
385
385
  function getWebpackConfig(ctx) {
386
- return cloneDeep(ctx.config);
386
+ return klona(ctx.config);
387
387
  }
388
388
 
389
389
  function assets(ctx) {
@@ -703,14 +703,6 @@ const orderPresets = {
703
703
  }
704
704
  };
705
705
  const getPostcssConfig = (nuxt) => {
706
- function defaultConfig() {
707
- return {
708
- sourceMap: nuxt.options.webpack.cssSourceMap,
709
- plugins: nuxt.options.postcss.plugins,
710
- // Array, String or Function
711
- order: "autoprefixerAndCssnanoLast"
712
- };
713
- }
714
706
  function sortPlugins({ plugins, order }) {
715
707
  const names = Object.keys(plugins);
716
708
  if (typeof order === "string") {
@@ -718,37 +710,30 @@ const getPostcssConfig = (nuxt) => {
718
710
  }
719
711
  return typeof order === "function" ? order(names, orderPresets) : order || names;
720
712
  }
721
- function loadPlugins(config) {
722
- if (!isPureObject(config.plugins)) {
723
- return;
724
- }
713
+ if (!nuxt.options.webpack.postcss || !nuxt.options.postcss) {
714
+ return false;
715
+ }
716
+ const postcssOptions = defu({}, nuxt.options.postcss, {
717
+ sourceMap: nuxt.options.webpack.cssSourceMap,
718
+ // Array, String or Function
719
+ order: "autoprefixerAndCssnanoLast"
720
+ });
721
+ if (!Array.isArray(postcssOptions.plugins) && isPureObject(postcssOptions.plugins)) {
725
722
  const cjs = createCommonJS(import.meta.url);
726
- config.plugins = sortPlugins(config).map((pluginName) => {
723
+ postcssOptions.plugins = sortPlugins(postcssOptions).map((pluginName) => {
727
724
  const pluginFn = requireModule(pluginName, { paths: [cjs.__dirname] });
728
- const pluginOptions = config.plugins[pluginName];
725
+ const pluginOptions = postcssOptions.plugins[pluginName];
729
726
  if (!pluginOptions || typeof pluginFn !== "function") {
730
727
  return null;
731
728
  }
732
729
  return pluginFn(pluginOptions);
733
730
  }).filter(Boolean);
734
731
  }
735
- if (!nuxt.options.webpack.postcss || !nuxt.options.postcss) {
736
- return false;
737
- }
738
- let postcssOptions = cloneDeep(nuxt.options.postcss);
739
- if (isPureObject(postcssOptions)) {
740
- if (Array.isArray(postcssOptions.plugins)) {
741
- defaults$1(postcssOptions, defaultConfig());
742
- } else {
743
- postcssOptions = merge({}, defaultConfig(), postcssOptions);
744
- loadPlugins(postcssOptions);
745
- }
746
- return {
747
- sourceMap: nuxt.options.webpack.cssSourceMap,
748
- ...nuxt.options.webpack.postcss,
749
- postcssOptions
750
- };
751
- }
732
+ return {
733
+ sourceMap: nuxt.options.webpack.cssSourceMap,
734
+ ...nuxt.options.webpack.postcss,
735
+ postcssOptions
736
+ };
752
737
  };
753
738
 
754
739
  function style(ctx) {
@@ -870,6 +855,9 @@ var __publicField$1 = (obj, key, value) => {
870
855
  __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
871
856
  return value;
872
857
  };
858
+ function uniq(items) {
859
+ return [...new Set(items)];
860
+ }
873
861
  class VueSSRClientPlugin {
874
862
  constructor(options) {
875
863
  __publicField$1(this, "options");
@@ -1204,6 +1192,7 @@ function serverStandalone(ctx) {
1204
1192
  "#app",
1205
1193
  "nuxt",
1206
1194
  "nuxt3",
1195
+ "nuxt-nightly",
1207
1196
  "!",
1208
1197
  "-!",
1209
1198
  "~",
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder",
3
- "version": "3.7.3",
3
+ "version": "3.8.0",
4
4
  "repository": "nuxt/nuxt",
5
+ "description": "Webpack bundler for Nuxt",
5
6
  "license": "MIT",
6
7
  "type": "module",
7
8
  "types": "./dist/index.d.ts",
@@ -17,7 +18,7 @@
17
18
  ],
18
19
  "dependencies": {
19
20
  "@nuxt/friendly-errors-webpack-plugin": "^2.5.2",
20
- "autoprefixer": "^10.4.15",
21
+ "autoprefixer": "^10.4.16",
21
22
  "css-loader": "^6.8.1",
22
23
  "css-minimizer-webpack-plugin": "^5.0.1",
23
24
  "cssnano": "^6.0.1",
@@ -26,49 +27,48 @@
26
27
  "escape-string-regexp": "^5.0.0",
27
28
  "estree-walker": "^3.0.3",
28
29
  "file-loader": "^6.2.0",
29
- "fork-ts-checker-webpack-plugin": "^8.0.0",
30
+ "fork-ts-checker-webpack-plugin": "^9.0.0",
30
31
  "fs-extra": "^11.1.1",
31
- "h3": "^1.8.1",
32
+ "h3": "^1.8.2",
32
33
  "hash-sum": "^2.0.0",
33
- "lodash-es": "^4.17.21",
34
- "magic-string": "^0.30.3",
35
- "memfs": "^4.2.1",
34
+ "klona": "^2.0.6",
35
+ "magic-string": "^0.30.5",
36
+ "memfs": "^4.6.0",
36
37
  "mini-css-extract-plugin": "^2.7.6",
37
38
  "mlly": "^1.4.2",
38
39
  "ohash": "^1.1.3",
39
40
  "pathe": "^1.1.1",
40
41
  "pify": "^6.1.0",
41
- "postcss": "^8.4.29",
42
+ "postcss": "^8.4.31",
42
43
  "postcss-import": "^15.1.0",
43
44
  "postcss-loader": "^7.3.3",
44
45
  "postcss-url": "^10.1.3",
45
46
  "pug-plain-loader": "^1.1.0",
46
47
  "std-env": "^3.4.3",
47
48
  "time-fix-plugin": "^2.0.7",
48
- "ufo": "^1.3.0",
49
- "unplugin": "^1.4.0",
49
+ "ufo": "^1.3.1",
50
+ "unplugin": "^1.5.0",
50
51
  "url-loader": "^4.1.1",
51
52
  "vue-bundle-renderer": "^2.0.0",
52
- "vue-loader": "^17.2.2",
53
- "webpack": "^5.88.2",
53
+ "vue-loader": "^17.3.0",
54
+ "webpack": "^5.89.0",
54
55
  "webpack-bundle-analyzer": "^4.9.1",
55
56
  "webpack-dev-middleware": "^6.1.1",
56
57
  "webpack-hot-middleware": "^2.25.4",
57
- "webpack-virtual-modules": "^0.5.0",
58
+ "webpack-virtual-modules": "^0.6.0",
58
59
  "webpackbar": "^5.0.2",
59
- "@nuxt/kit": "3.7.3"
60
+ "@nuxt/kit": "3.8.0"
60
61
  },
61
62
  "devDependencies": {
62
- "@types/fs-extra": "11.0.1",
63
- "@types/hash-sum": "1.0.0",
64
- "@types/lodash-es": "4.17.9",
65
- "@types/pify": "5.0.1",
66
- "@types/webpack-bundle-analyzer": "4.6.0",
67
- "@types/webpack-hot-middleware": "2.25.6",
68
- "@types/webpack-virtual-modules": "0.1.1",
63
+ "@types/fs-extra": "11.0.3",
64
+ "@types/hash-sum": "1.0.1",
65
+ "@types/pify": "5.0.3",
66
+ "@types/webpack-bundle-analyzer": "4.6.2",
67
+ "@types/webpack-hot-middleware": "2.25.8",
68
+ "@types/webpack-virtual-modules": "0.1.3",
69
69
  "unbuild": "latest",
70
70
  "vue": "3.3.4",
71
- "@nuxt/schema": "3.7.3"
71
+ "@nuxt/schema": "3.8.0"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "vue": "^3.3.4"