]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
fix: reinstate ESM browser builds (#2572)
authorskirtle <65301168+skirtles-code@users.noreply.github.com>
Thu, 16 Oct 2025 05:21:15 +0000 (06:21 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Oct 2025 05:21:15 +0000 (07:21 +0200)
packages/router/tsdown.config.ts

index ba9641556fdfde4159a13391ae7740c404cc645c..987b77262b3761f4a899fdff16425ee22cef2e97 100644 (file)
@@ -63,6 +63,34 @@ const esm = {
   // sourcemap: true,
 } satisfies Options
 
+const esmBrowser = {
+  ...commonOptions,
+  outputOptions: {
+    ...commonOptions.outputOptions,
+    dir: undefined, // must be unset with file
+    file: 'dist/vue-router.esm-browser.js',
+  },
+  define: {
+    ...commonOptions.define,
+    __DEV__: 'true',
+    __FEATURE_PROD_DEVTOOLS__: 'true',
+  },
+} satisfies Options
+
+const esmBrowserProd = {
+  ...esmBrowser,
+  minify: true,
+  outputOptions: {
+    ...esmBrowser.outputOptions,
+    file: 'dist/vue-router.esm-browser.prod.js',
+  },
+  define: {
+    ...esmBrowser.define,
+    __DEV__: 'false',
+    __FEATURE_PROD_DEVTOOLS__: 'false',
+  },
+} satisfies Options
+
 const cjs = {
   ...commonOptions,
   format: 'cjs',
@@ -122,6 +150,8 @@ const iifeProd = {
 export default [
   //
   esm,
+  esmBrowser,
+  esmBrowserProd,
   cjs,
   cjsProd,
   iife,