@nuxt/module-builder
1.0.4 · 11 Nov 2026MIT146.9k / weekRepositoryHomepagenpmAtom feed
32 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 1.x · latest line
1.0.4
11 Nov 2026Resolve runtime imports under paths with special chars
Allow
@nuxt/cliv4 in peer dependenciesRewrite
#apptonuxt/appin build output
v1.0.4 is the next patch release.
Changelog
Fixes
Resolve runtime imports under paths with special chars
Allow
@nuxt/cliv4 in peer dependenciesRewrite
#apptonuxt/appin build output
1.0.3
23 Jul 2026Update command defaults and descriptions
v1.0.3 is the next patch release.
Changelog
Fixes
Update command defaults and descriptions
1.0.2
25 Jul 2025Use absolute path for jiti stub
1.0.1
8 Apr 20251.0.0
4 Apr 2025- Breaking
Upgrade to unbuild v3
This major upgrade brings significant changes to the build proces but should be significantly better. - Breaking
Removal of Node10 module resolution and CommonJS output
As Nuxt 2 has reached EOL, we no longer generate CJS by default, and we have also removed the 'CJS bridge' feature that polyfilled__filenameand__dirname. - Breaking
Type errors. The module builder will now error if there are type errors when generating your
runtime/*files. (Previously warnings were logged but your build would have succeeded.) Errors you receive aren't caused by the upgrade, but you might need to correct any issues before your module will build again.
With the release of unbuild v3, the EOL status of Nuxt 2, and looking forward to Nuxt 4, we're taking the opportunity to release v1 of
@nuxt/module-builder, with a range of breaking changes.Breaking Changes
- Breaking
Upgrade to unbuild v3
This major upgrade brings significant changes to the build proces but should be significantly better. - Breaking
Removal of Node10 module resolution and CommonJS output
As Nuxt 2 has reached EOL, we no longer generate CJS by default, and we have also removed the 'CJS bridge' feature that polyfilled__filenameand__dirname. - Breaking
Type errors. The module builder will now error if there are type errors when generating your
runtime/*files. (Previously warnings were logged but your build would have succeeded.) Errors you receive aren't caused by the upgrade, but you might need to correct any issues before your module will build again.
Migration Guide
Replacing
__filenameand__dirnameWe no longer polyfill these CommonJS variables. Instead, use the
createResolverutility from@nuxt/kit:import { createResolver } from '@nuxt/kit' // Instead of __dirname and __filename const resolver= createResolver(import.meta.url) const runtimeDir = resolver.resolve('./runtime')Module Resolution Changes
We no longer officially support Node10 module resolution, meaning you should remove the
types/typefield from yourpackage.json. If you need to maintain compatibility with older Node.js versions or systems expecting CommonJS, you can use thetypesVersionsfield in yourpackage.json.This field allows typing subpath exports (like
my-module/utils) even with oldermoduleResolutionsettings. Regardless, we recommend all Nuxt users to useBundlermodule resolution.{ "typesVersions": { "*": { ".": [ "dist/index.d.mts" ], "some-subpath": [ "dist/some-subpath.d.mts" ] } } }ESM-only Output
We no longer generate CommonJS (
.cjs) output files by default, as this was primarily needed for Nuxt 2 compatibility. You should:- Breaking
Set
"type": "module"in your package.json - Breaking
Update any mentions of
.cjsfiles in yourpackage.json
For example:
+ "type": "module", "exports": { ".": { - "types": "./dist/types.d.ts", + "types": "./dist/types.d.mts", "import": "./dist/module.mjs", - "require": "./dist/module.cjs" }, - "./utils": { - "types": "./dist/utils.d.mts", - "import": "./dist/utils.mjs", - "require": "./dist/utils.cjs" + "./utils": "./dist/utils.mjs" }, - "main": "./dist/module.cjs", + "main": "./dist/module.mjs", - "types": "./dist/module.d.ts", + "typesVersions": { + "*": { + ".": [ + "./dist/types.d.mts" + ], + "utils": [ + "./dist/utils.d.mts" + ] + } + }, "files": [ - "utils.d.ts" "dist" ],Configuring unbuild
You can still customize the build process by extending the unbuild configuration in your
buildOptions.To customize/extend the unbuild configuration you can add a
build.config.tsin the root of your project:import { defineBuildConfig } from 'unbuild' export default defineBuildConfig({ // set additional configuration or customize using hooks rollupOptions: { // for example, if you wish to continue to generate `.cjs` output emitCJS: true } })Changelog
Enhancements
- Breaking
⚠️ Upgrade to unbuild v3
- Breaking
⚠️ Remove support for node10 resolution + cjs
build: Ignore test + story files in runtime/ directory
Add support for type exports in module re-exports
Fixes
Mark nuxi as optional peerDep
Drop @nuxt/kit peer dependency & remove optionality for nuxi
build: Handle windows path names
build: Apply resolved tsconfig to dts
Handle node10 resolution + add attw test
Update warnings
Support more than one line of type exports
Split re-exports across multiple lines
Support star exports
CI
Breaking Changes
- Breaking
⚠️ Upgrade to unbuild v3
- Breaking
⚠️ Remove support for node10 resolution + cjs
- 0.8.x
0.8.4
10 Sep 2024Remove
nuxt/schemaaugment
0.8.3
13 Aug 2024build: Handle missing named type exports
0.8.2
13 Aug 2024Removed unnecessary hasTypeExport check
prepare: Override
compatibilityDate
Performance
Removed unnecessary hasTypeExport check
Fixes
prepare: Override
compatibilityDate
0.8.1
28 Jun 2024build: Export all types in stub mode
0.8.0
19 Jun 2024- Breaking
⚠️ Do not augment nuxt options inside module entry
- Breaking
⚠️ Do not augment nuxt options inside module entry
build: Do not export default as a type
Fixes
- Breaking
⚠️ Do not augment nuxt options inside module entry
build: Do not export default as a type
build: Only generate
import typestatement if required
Breaking Changes
- Breaking
⚠️ Do not augment nuxt options inside module entry
- 0.7.x
0.7.1
11 Jun 2024build: Declare
ModuleOptionsin correct place
0.7.0
22 May 2024- Breaking
⚠️ Use
.jsextension for files inruntime/directory - Breaking
⚠️ Use
.jsextension for files inruntime/directory Auto generate module options from schema meta
Enhancements
Auto generate module options from schema meta
Fixes
Use
tsconfckto resolve tsconfigcompilerOptions- Breaking
⚠️ Use
.jsextension for files inruntime/directory Resolve full path to runtime externals
Include
dist/runtimein externals list
CI
Breaking Changes
- Breaking
⚠️ Use
.jsextension for files inruntime/directory
- 0.6.x
0.6.0
25 Apr 2024- Breaking
⚠️ Remove support for deprecated
RuntimeModuleHooksinterface - Breaking
⚠️ Remove support for deprecated
RuntimeModuleHooksinterface Generate
runtime/dts based on nuxttsconfigoptions
Enhancements
Generate
runtime/dts based on nuxttsconfigoptionsAdd builder versions to
module.jsonSupport transforming
jsx
Fixes
- Breaking
⚠️ Remove support for deprecated
RuntimeModuleHooksinterface Add
-nightlyversions to externalsIgnore exporting type if it is not defined
Mark
runtime/directory as external
Tests
Breaking Changes
- Breaking
⚠️ Remove support for deprecated
RuntimeModuleHooksinterface
- 0.5.x
0.5.5
26 Dec 2023Rename
RuntimeModuleHookstoModuleRuntimeHooksUse import with extension in generated
.d.mtsfile
Fixes
Rename
RuntimeModuleHookstoModuleRuntimeHooksUse import with extension in generated
.d.mtsfile
0.5.4
8 Nov 2023Support writing
RuntimeNuxtHookstypesGenerate explicit type import/exports
Enhancements
Support writing
RuntimeNuxtHookstypes
Fixes
Generate explicit type import/exports
0.5.3
6 Nov 2023Esnext-compatible output
0.5.2
28 Sep 20230.5.1
31 Aug 2023Support
--sourcemapoption
0.5.0
28 Aug 2023Expose
prepareModulefunctionUpgrade to
unbuild@2
- 0.4.x
0.4.0
26 May 2023Add
preparecommand for local types support
- 0.3.x
- 0.2.x
0.2.1
16 Nov 20220.2.0
15 Oct 2022Export all module types in
types.d.tsSupport
ModuleRuntimeConfigandModulePublicRuntimeConfigtype exportsSupport
outDiroption
Features
Export all module types in
types.d.tsSupport
ModuleRuntimeConfigandModulePublicRuntimeConfigtype exportsSupport
outDiroption
Bug Fixes
pkg: export
./package.jsonsubpath
- 0.1.x
- 0.0.x
0.0.0
3 Dec 2021
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.