Skip to content

Commit

Permalink
使用umd打包
Browse files Browse the repository at this point in the history
  • Loading branch information
DBSDs committed Nov 20, 2024
1 parent ff6032d commit 0cd0a2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/workflows/git-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": [
"中国身份证",
Expand All @@ -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": "[email protected]:DBSDs/idcard.js.git"
},
"homepage": "https://dbsds.github.io/idcard.js/",
"engines": {
"node": ">=19",
Expand Down
27 changes: 1 addition & 26 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -43,7 +36,6 @@ const prodPlugins = plugins.concat([
terser(),
filesize(),
typescript({
// rollupCommonJSResolveHack: false,
outDir: "./types",
clean: true,
}),
Expand All @@ -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);

0 comments on commit 0cd0a2c

Please sign in to comment.