Skip to content

Commit

Permalink
chore: fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
chizuki committed Nov 24, 2022
1 parent 8e7f192 commit 748d99c
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 327 deletions.
11 changes: 11 additions & 0 deletions packages/hoci/build.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { defineBuildConfig } from "unbuild";
import fs from "fs"

export default defineBuildConfig({
entries: ["src/index"],
externals: ["vue", "@vueuse/core"],
clean: true,
declaration: true,
failOnWarn: false,
hooks: {
"rollup:done": async (options) => {
await fs.promises.rename("dist/index.mjs", "dist/index.esm.js")
}
},
rollup: {
emitCJS: true,
dts: {
respectExternal: false
},
esbuild: {
target: "es2015",

}
}
});
49 changes: 28 additions & 21 deletions packages/hoci/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
{
"name": "hoci",
"version": "0.0.3",
"description": "",
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist/"
],
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub"
"name": "hoci",
"version": "0.0.3",
"description": "",
"main": "dist/index.cjs",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
"files": [
"dist/"
],
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs"
},
"author": "chizuki",
"license": "MIT",
"dependencies": {
"@vueuse/core": "^9.5.0",
"maybe-types": "^0.0.3"
},
"peerDependencies": {
"vue": "^3.2.45"
}
"./package.json": "./package.json"
},
"scripts": {
"build": "unbuild",
"stub": "unbuild --stub"
},
"author": "chizuki",
"license": "MIT",
"dependencies": {
"@vueuse/core": "^9.1.0",
"maybe-types": "^0.0.3"
},
"devDependencies": {
"vue": "^3.2.31"
}
}
2 changes: 1 addition & 1 deletion packages/hoci/src/components/switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const switchProps = defineHookProps({
}
});

const switchEmits = defineHookEmits(["update:modelValue", "change"]);
export const switchEmits = defineHookEmits(["update:modelValue", "change"]);

export const useSwitch = defineHookComponent({
props: switchProps,
Expand Down
2 changes: 1 addition & 1 deletion playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"element-plus": "^2.2.18",
"jquery": "^3.6.0",
"query-string": "^7.1.1",
"vue": "^3.2.37",
"vue": "^3.2.31",
"vue-router": "^4.1.2"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 748d99c

Please sign in to comment.