Skip to content

Commit d5708f5

Browse files
fix: bring back CommonJS support
1 parent 421176f commit d5708f5

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

build.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineBuildConfig } from 'unbuild';
2+
3+
export default defineBuildConfig({
4+
rollup: {
5+
emitCJS: true,
6+
},
7+
});

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,22 @@
2424
"exports": {
2525
".": {
2626
"types": "./dist/types.d.mts",
27-
"import": "./dist/module.mjs"
27+
"import": "./dist/module.mjs",
28+
"require": "./dist/module.cjs"
2829
}
2930
},
31+
"main": "./dist/module.cjs",
32+
"types": "./dist/types.d.mts",
3033
"files": [
3134
"dist"
3235
],
3336
"scripts": {
3437
"dev": "nuxi dev playground",
3538
"dev:build": "nuxi build playground",
36-
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
37-
"build": "nuxt-module-build && nuxi build playground",
39+
"dev:prepare": "nuxt-module-build build --stub && nuxi prepare playground",
40+
"build": "nuxt-module-build build && nuxi build playground",
3841
"lint": "eslint .",
39-
"prepublishOnly": "nuxi prepare playground && yarn lint && nuxt-module-build"
42+
"prepublishOnly": "nuxi prepare playground && yarn lint && nuxt-module-build build"
4043
},
4144
"dependencies": {
4245
"@nuxt/kit": "^4.0.0",

0 commit comments

Comments
 (0)