Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion custom-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import type { ExternalVuetifyOptions } from './dist/module'
import type { ExternalVuetifyOptions } from './dist/module.js'
declare function defineVuetifyConfiguration(vuetifyOptions: ExternalVuetifyOptions): ExternalVuetifyOptions;
export { defineVuetifyConfiguration };
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"./*": "./*"
},
"main": "./dist/module.cjs",
"main": "./dist/module.mjs",
"types": "./dist/types.d.ts",
"files": [
"dist",
Expand All @@ -42,7 +42,7 @@
"*.mjs"
],
"scripts": {
"prepack": "nuxt-module-build prepare && nuxt-module-build build",
"prepack": "nuxt-module-build prepare && nuxt-module-build build && jiti scripts/postbuild.ts",
"dev": "nuxi dev playground",
"dev:multiple-json": "MULTIPLE_LANG_FILES=true nuxi dev playground",
"dev:prepare": "nuxt-module-build --stub && nuxt-module-build prepare && nuxi prepare playground",
Expand Down
14 changes: 14 additions & 0 deletions scripts/postbuild.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { readFileSync, writeFileSync } from 'node:fs'
import { resolve } from 'node:path'

// fix d.mts imports
const mDtsModule = resolve('dist/types.d.mts')
const mDtsModuleContent = readFileSync(mDtsModule, 'utf-8')
writeFileSync(
mDtsModule,
mDtsModuleContent.replaceAll(
'from \'./module\'',
'from \'./module.js\'',
),
'utf-8',
)