Skip to content

Commit

Permalink
feat: add esm support (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin authored Dec 31, 2021
1 parent 43b9554 commit c5c149b
Show file tree
Hide file tree
Showing 9 changed files with 1,714 additions and 924 deletions.
15 changes: 15 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
'src/node/index',
],
clean: true,
declaration: true,
externals: [
'vite',
],
rollup: {
emitCJS: true,
},
})
84 changes: 45 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,26 @@
"funding": "https://github.com/sponsors/antfu",
"license": "MIT",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
"require": "./dist/index.cjs",
"import": "./dist/index.mjs",
"types": "./dist/index.d.ts"
},
"./*": "./*"
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
"dist",
"*.d.ts"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "rimraf dist && run-s build:*",
"dev": "vite src/client",
"build:js": "tsup src/node/index.ts --format cjs,esm --dts --env.NODE_ENV production",
"build:js": "unbuild",
"build:client": "vite build src/client",
"dev:js": "nr build:js --watch src",
"dev:client": "vite build src/client --watch",
Expand All @@ -43,53 +45,57 @@
"test": "jest"
},
"dependencies": {
"debug": "^4.3.2",
"sirv": "^1.0.17",
"debug": "^4.3.3",
"sirv": "^2.0.0",
"ufo": "^0.7.9"
},
"devDependencies": {
"@antfu/eslint-config": "^0.9.0",
"@antfu/ni": "^0.9.3",
"@antfu/utils": "^0.3.0",
"@iconify/json": "^1.1.403",
"@rollup/pluginutils": "^4.1.1",
"@types/codemirror": "^5.60.2",
"@antfu/eslint-config": "^0.14.2",
"@antfu/ni": "^0.12.0",
"@antfu/utils": "^0.4.0",
"@iconify/json": "^2.0.17",
"@rollup/pluginutils": "^4.1.2",
"@types/codemirror": "^5.60.5",
"@types/debug": "^4.1.7",
"@types/diff-match-patch": "^1.0.32",
"@types/fs-extra": "^9.0.12",
"@types/node": "^16.9.2",
"@vitejs/plugin-vue": "^1.8.0",
"@vue/compiler-sfc": "^3.2.12",
"@vueuse/core": "^6.4.1",
"@vueuse/router": "^6.4.1",
"@types/fs-extra": "^9.0.13",
"@types/node": "^17.0.5",
"@vitejs/plugin-vue": "^2.0.1",
"@vue/compiler-sfc": "^3.2.26",
"@vueuse/core": "^7.4.3",
"@vueuse/router": "^7.4.3",
"bumpp": "^7.1.1",
"chalk": "^4.1.2",
"codemirror": "^5.62.3",
"codemirror": "^5.65.0",
"codemirror-theme-vars": "^0.1.1",
"diff-match-patch": "^1.0.5",
"eslint": "^7.32.0",
"eslint-plugin-jest": "^24.4.2",
"esno": "^0.9.1",
"fuse.js": "^6.4.6",
"eslint": "^8.5.0",
"eslint-plugin-jest": "^25.3.2",
"esno": "^0.13.0",
"fuse.js": "^6.5.3",
"kolorist": "^1.5.1",
"npm-run-all": "^4.1.5",
"prism-theme-vars": "^0.2.2",
"rimraf": "^3.0.2",
"tsup": "^5.1.0",
"typescript": "^4.4.3",
"unplugin-auto-import": "^0.4.6",
"unplugin-icons": "^0.11.3",
"unplugin-vue-components": "^0.15.2",
"tsup": "^5.11.9",
"typescript": "^4.5.4",
"unbuild": "^0.6.7",
"unplugin-auto-import": "^0.5.5",
"unplugin-icons": "^0.13.0",
"unplugin-vue-components": "^0.17.11",
"vis-data": "^7.1.2",
"vis-network": "^9.1.0",
"vite": "^2.5.10",
"vite-plugin-optimize-persist": "^0.0.5",
"vite-plugin-package-config": "^0.0.3",
"vite-plugin-pages": "^0.18.1",
"vite-plugin-windicss": "^1.4.3",
"vue": "^3.2.12",
"vue-router": "^4.0.11"
"vite": "^2.7.10",
"vite-plugin-optimize-persist": "^0.1.2",
"vite-plugin-package-config": "^0.1.1",
"vite-plugin-pages": "^0.19.8",
"vite-plugin-windicss": "^1.6.1",
"vue": "^3.2.26",
"vue-router": "^4.0.12"
},
"peerDependencies": {
"vite": "^2.0.0"
},
"engines": {
"node": ">=14"
}
}
Loading

0 comments on commit c5c149b

Please sign in to comment.