Skip to content

Commit 4e7fa75

Browse files
committed
release: v1.4.1
1 parent fe9f2da commit 4e7fa75

File tree

18 files changed

+259
-171
lines changed

18 files changed

+259
-171
lines changed

README.md

Lines changed: 86 additions & 83 deletions
Large diffs are not rendered by default.

dev-server/index.js

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ if (!fs.existsSync(distPath)) {
2222
process.exit(1);
2323
}
2424

25+
const srcPath = path.join(__dirname, "../src");
26+
const nodeModulesPath = path.join(__dirname, "../node_modules");
27+
2528
const app = express();
2629

2730
// Rate limiting
@@ -41,8 +44,23 @@ app.use(
4144
})
4245
);
4346

47+
let httpPort = 3000;
48+
let httpsPort = 3001;
49+
4450
// Serve static files
45-
app.use("/dist", express.static(distPath));
51+
// Use setHeaders to inject the SourceMap header pointing to the HTTP port
52+
// This works around the Firefox self-signed certificate issue for source maps
53+
app.use("/dist", express.static(distPath, {
54+
setHeaders: (res, filePath) => {
55+
if (filePath.endsWith(".js") || filePath.endsWith(".mjs")) {
56+
const filename = path.basename(filePath);
57+
res.setHeader("SourceMap", `http://localhost:${httpPort}/dist/${filename}.map`);
58+
}
59+
}
60+
}));
61+
62+
app.use("/src", express.static(srcPath));
63+
app.use("/node_modules", express.static(nodeModulesPath));
4664
app.use("/assets", express.static(path.join(__dirname, "../samples/demo/assets")));
4765
app.use("/css", express.static(path.join(__dirname, "../samples/demo/css")));
4866
app.use("/font", express.static(path.join(__dirname, "../samples/demo/font")));
@@ -136,9 +154,6 @@ app.post("/upload", function (req, res) {
136154
}
137155
});
138156

139-
let httpPort = 3000;
140-
let httpsPort = 3001;
141-
142157
// redirect handling
143158
app.use((req, res, next) => {
144159
const host = req.get("Host"); // Get the host name from the request

dist/dds.bundle.esm.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dds.bundle.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dds.bundle.mjs

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 106 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dynamsoft-document-scanner",
3-
"version": "1.4.0",
3+
"version": "1.4.1",
44
"description": "Dynamsoft Document Scanner (DDS) is a ready-to-use SDK for capturing and enhancing document images with automatic border detection, correction, and customizable workflows.",
55
"files": [
66
"/dist",
@@ -24,6 +24,7 @@
2424
"scripts": {
2525
"serve": "node dev-server/index.js",
2626
"build": "rollup -c",
27+
"build:development": "rollup -c --environment BUILD:development",
2728
"build:production": "rollup -c --environment BUILD:production"
2829
},
2930
"repository": {
@@ -53,7 +54,7 @@
5354
"@rollup/plugin-typescript": "^11.1.6",
5455
"@types/node": "^20.11.6",
5556
"cors": "^2.8.5",
56-
"dynamsoft-capture-vision-bundle": "3.2.4000",
57+
"dynamsoft-capture-vision-bundle": "^3.2.5000",
5758
"express": "^4.21.2",
5859
"express-rate-limit": "^8.2.1",
5960
"formidable": "^3.5.2",

rollup.config.mjs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { dts } from "rollup-plugin-dts";
88
const pkg = JSON.parse(await fs.promises.readFile("./package.json"));
99
const version = pkg.version;
1010

11+
// Check build mode from environment variable
12+
const isDev = process.env.BUILD === "development";
13+
const enableSourceMaps = isDev; // Enable source maps in dev mode
14+
1115
fs.rmSync("dist", { recursive: true, force: true });
1216

1317
const strProduct = "Dynamsoft Document Scanner JS Edition Bundle";
@@ -60,7 +64,7 @@ export default [
6064
typescript({
6165
tsconfig: "./tsconfig.json",
6266
declaration: true,
63-
sourceMap: false,
67+
sourceMap: enableSourceMaps,
6468
}),
6569
plugin_terser_es5,
6670
copyFiles(),
@@ -80,7 +84,7 @@ export default [
8084
name: "Dynamsoft",
8185
banner: banner,
8286
exports: "named",
83-
sourcemap: false,
87+
sourcemap: enableSourceMaps,
8488
},
8589
],
8690
},
@@ -92,7 +96,7 @@ export default [
9296
typescript({
9397
tsconfig: "./tsconfig.json",
9498
declaration: true,
95-
sourceMap: false,
99+
sourceMap: enableSourceMaps,
96100
}),
97101
plugin_terser_es6,
98102
],
@@ -102,7 +106,7 @@ export default [
102106
format: "es",
103107
banner: banner,
104108
exports: "named",
105-
sourcemap: false,
109+
sourcemap: enableSourceMaps,
106110
},
107111
],
108112
},
@@ -113,7 +117,7 @@ export default [
113117
nodeResolve({ browser: true }),
114118
typescript({
115119
tsconfig: "./tsconfig.json",
116-
sourceMap: false,
120+
sourceMap: enableSourceMaps,
117121
}),
118122
plugin_terser_es6,
119123
],
@@ -123,7 +127,7 @@ export default [
123127
format: "es",
124128
banner: banner,
125129
exports: "named",
126-
sourcemap: false,
130+
sourcemap: enableSourceMaps,
127131
},
128132
],
129133
},

samples/demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>Dynamsoft Document Scanner</title>
77
<link rel="stylesheet" href="./css/index.css" />
8-
<!-- <script src="https://cdn.jsdelivr.net/npm/dynamsoft-document-scanner@1.4.0/dist/dds.bundle.js"></script> -->
8+
<!-- <script src="https://cdn.jsdelivr.net/npm/dynamsoft-document-scanner@1.4.1/dist/dds.bundle.js"></script> -->
99
<!-- To use locally: -->
1010
<script src="../../dist/dds.bundle.js"></script>
1111
</head>

samples/frameworks/angular/angular.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,8 @@
8989
}
9090
}
9191
}
92+
},
93+
"cli": {
94+
"analytics": false
9295
}
9396
}

0 commit comments

Comments
 (0)