@nuxt/webpack-builder-nightly 5.0.0-29777508.1792fe11 → 5.0.0-29778218.1397500a

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 (2) hide show
  1. package/dist/index.mjs +44 -2
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -790,10 +790,49 @@ function basePlugins(ctx) {
790
790
  ctx.config.plugins.push(new StripInvalidPureAnnotationsPlugin());
791
791
  }
792
792
  }
793
+ /**
794
+ * Pin the packages that hold global vue state (`currentInstance`, reactivity
795
+ * internals, injection keys) to a single resolved entry, mirroring vite's
796
+ * `resolve.dedupe: ['vue']`.
797
+ */
798
+ function vueAliases(ctx) {
799
+ const aliases = {};
800
+ const from = [
801
+ directoryToURL(ctx.nuxt.options.rootDir),
802
+ directoryToURL(ctx.nuxt.options.workspaceDir),
803
+ import.meta.url
804
+ ];
805
+ const conditions = ctx.isServer ? [
806
+ "node",
807
+ "import",
808
+ "default"
809
+ ] : [
810
+ "browser",
811
+ "import",
812
+ "default"
813
+ ];
814
+ for (const pkg of [
815
+ "@vue/runtime-core",
816
+ "@vue/runtime-dom",
817
+ "@vue/reactivity",
818
+ "@vue/shared",
819
+ "@vue/runtime-vapor",
820
+ "vue-router"
821
+ ]) {
822
+ const entry = resolveModulePath(pkg, {
823
+ from,
824
+ conditions,
825
+ try: true
826
+ });
827
+ if (entry) aliases[`${pkg}$`] = entry;
828
+ }
829
+ return aliases;
830
+ }
793
831
  function baseAlias(ctx) {
794
832
  ctx.alias = {
795
833
  "#app": ctx.options.appDir,
796
834
  [basename(ctx.nuxt.options.dir.assets)]: resolve(ctx.nuxt.options.srcDir, ctx.nuxt.options.dir.assets),
835
+ ...vueAliases(ctx),
797
836
  ...ctx.options.alias,
798
837
  ...ctx.alias
799
838
  };
@@ -843,10 +882,13 @@ function baseResolve(ctx) {
843
882
  ".json",
844
883
  ".vue"
845
884
  ],
846
- alias: ctx.alias,
847
885
  modules: resolveModules,
848
886
  fullySpecified: false,
849
- ...ctx.config.resolve
887
+ ...ctx.config.resolve,
888
+ alias: {
889
+ ...ctx.alias,
890
+ ...ctx.config.resolve?.alias
891
+ }
850
892
  };
851
893
  ctx.config.resolveLoader = {
852
894
  modules: resolveLoaderModules,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/webpack-builder-nightly",
3
- "version": "5.0.0-29777508.1792fe11",
3
+ "version": "5.0.0-29778218.1397500a",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -24,7 +24,7 @@
24
24
  ],
25
25
  "dependencies": {
26
26
  "@nuxt/friendly-errors-webpack-plugin": "^2.6.0",
27
- "@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-29777508.1792fe11",
27
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-29778218.1397500a",
28
28
  "@vue/compiler-sfc": "3.5.40",
29
29
  "autoprefixer": "^10.5.4",
30
30
  "css-loader": "^7.1.4",
@@ -65,7 +65,7 @@
65
65
  "webpackbar": "^7.0.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-29777508.1792fe11",
68
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-29778218.1397500a",
69
69
  "@rspack/core": "2.1.7",
70
70
  "@types/hash-sum": "1.0.2",
71
71
  "@types/webpack-bundle-analyzer": "4.7.0",
@@ -77,7 +77,7 @@
77
77
  "vue": "^3.5.40"
78
78
  },
79
79
  "peerDependencies": {
80
- "nuxt": "npm:nuxt-nightly@5.0.0-29777508.1792fe11",
80
+ "nuxt": "npm:nuxt-nightly@5.0.0-29778218.1397500a",
81
81
  "vue": "^3.3.4"
82
82
  },
83
83
  "engines": {