import { type Options } from 'tsdown'
import pkg from './package.json' with { type: 'json' }
+import fs from 'node:fs/promises'
+import { dirname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const __dirname = dirname(fileURLToPath(import.meta.url))
const banner = `
/*!
__FEATURE_PROD_DEVTOOLS__: `__VUE_PROD_DEVTOOLS__`,
},
dts: false,
+ // TODO: remove in v5
+ async onSuccess() {
+ // write a stub file for vue-router.esm-bundler.js
+ await fs.writeFile(
+ resolve(__dirname, 'dist/vue-router.esm-bundler.js'),
+ `
+console.warn("[vue-router]: importing from 'vue-router/dist/vue-router.esm-bundler.js' is deprecated. Use 'vue-router' directly.")
+export * from './vue-router.mjs'
+`.trimStart()
+ )
+ },
} satisfies Options
const esm = {