File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11import { type Options } from 'tsdown'
22import pkg from './package.json' with { type : 'json' }
3+ import fs from 'node:fs/promises'
4+ import { dirname , resolve } from 'node:path'
5+ import { fileURLToPath } from 'node:url'
6+
7+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) )
38
49const banner = `
510/*!
@@ -34,6 +39,17 @@ const commonOptions = {
3439 __FEATURE_PROD_DEVTOOLS__ : `__VUE_PROD_DEVTOOLS__` ,
3540 } ,
3641 dts : false ,
42+ // TODO: remove in v5
43+ async onSuccess ( ) {
44+ // write a stub file for vue-router.esm-bundler.js
45+ await fs . writeFile (
46+ resolve ( __dirname , 'dist/vue-router.esm-bundler.js' ) ,
47+ `
48+ console.warn("[vue-router]: importing from 'vue-router/dist/vue-router.esm-bundler.js' is deprecated. Use 'vue-router' directly.")
49+ export * from './vue-router.mjs'
50+ ` . trimStart ( )
51+ )
52+ } ,
3753} satisfies Options
3854
3955const esm = {
You can’t perform that action at this time.
0 commit comments