diff --git a/.github/workflows/git-pages.yml b/.github/workflows/git-pages.yml index 46aaa2b..0dd20f0 100644 --- a/.github/workflows/git-pages.yml +++ b/.github/workflows/git-pages.yml @@ -17,6 +17,7 @@ jobs: - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. run: | + pnpm install --lockfile-only pnpm install pnpm build pnpm build:site diff --git a/package.json b/package.json index ed7c35d..de871e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "idcard.js", - "version": "1.0.3", + "version": "1.0.5", "description": "基于tesseract.js,识别中国身份证ORC,识别信息可用于填入表单", "main": "dist/index.js", "type": "module", @@ -9,7 +9,8 @@ "build": "rollup -c", "watch": "rollup -w -c", "dev": "pnpm --filter website start", - "build:site": "pnpm --filter website build" + "build:site": "pnpm --filter website build", + "prepublishOnly": "pnpm build" }, "keywords": [ "中国身份证", @@ -18,11 +19,15 @@ "扫描", "识别", "ORC", - "javascript" + "javascript", + "node.js" ], "author": "op_chen", "license": "MIT", - "repository": "https://github.com/DBSDs/idcard.js", + "repository": { + "type": "github", + "url": "git@github.com:DBSDs/idcard.js.git" + }, "homepage": "https://dbsds.github.io/idcard.js/", "engines": { "node": ">=19", diff --git a/rollup.config.js b/rollup.config.js index bb1efbc..3fd4404 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -28,13 +28,6 @@ const plugins = [ }), ]; -const devPlugins = plugins.concat([ - replace({ - "process.env.NODE_ENV": JSON.stringify("development"), - preventAssignment: true, - }), -]); - const prodPlugins = plugins.concat([ replace({ "process.env.NODE_ENV": JSON.stringify("production"), @@ -43,7 +36,6 @@ const prodPlugins = plugins.concat([ terser(), filesize(), typescript({ - // rollupCommonJSResolveHack: false, outDir: "./types", clean: true, }), @@ -68,26 +60,9 @@ export default [ { name: "idcard.js", dir: "dist", - format: "es", + format: "umd", }, ].map(makeOutput), plugins: prodPlugins, }, - // { - // output: [{ - // name: "WaterMark", - // file: "dist/watermark.js", - // format: "umd", - // }, - // { - // file: "dist/watermark.es.js", - // format: "es", - // }, - // { - // file: "dist/watermark.cjs.js", - // format: "cjs", - // }, - // ].map(makeOutput), - // plugins: devPlugins, - // }, ].map(withBase);