Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"rollup-plugin-license": "^2.1.0",
"rollup-plugin-node-resolve": "4.2.3",
"rollup-plugin-preprocess": "0.0.4",
"rollup-plugin-terser": "^6.1.0",
"@rollup/plugin-terser": "^0.4.4",
"typescript": "^3.9.6"
},
"license": "MIT",
Expand Down
2,939 changes: 1,785 additions & 1,154 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
},
"dependencies": {
"@babel/runtime": "^7.26.9",
"atob": "^2.1.2",
"btoa": "^1.2.1",
"fflate": "^0.8.1"
"fflate": "^0.8.1",
"fast-png": "^6.2.0"
},
"optionalDependencies": {
"canvg": "^3.0.11",
Expand All @@ -40,6 +39,7 @@
"@babel/preset-env": "^7.10.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-replace": "^2.3.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^8.0.0",
"@types/jasmine": "^3.5.11",
"@types/node": "^20.16.5",
Expand Down Expand Up @@ -82,7 +82,6 @@
"rollup-plugin-license": "^2.1.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-preprocess": "0.0.4",
"rollup-plugin-terser": "^6.1.0",
"typescript": "^5.6.2",
"yarpm": "^0.2.1"
},
Expand Down
25 changes: 19 additions & 6 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { terser } from "rollup-plugin-terser";
import terser from "@rollup/plugin-terser";
import { babel } from "@rollup/plugin-babel";
import RollupPluginPreprocess from "rollup-plugin-preprocess";
import resolve from "rollup-plugin-node-resolve";
Expand Down Expand Up @@ -37,6 +37,19 @@ const umdExternals = matchSubmodules([
...Object.keys(pkg.peerDependencies || {}),
...Object.keys(pkg.optionalDependencies || {})
]);

const terserOptions = {
ecma: 2023,
module: true,
compress: {
ecma: 2023,
passes: 2
},
mangle: {
safari10: true
}
};

const externals = matchSubmodules([
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
Expand All @@ -57,7 +70,7 @@ const umd = {
file: "dist/jspdf.umd.min.js",
format: "umd",
name: "jspdf",
plugins: [terser({})],
plugins: [terser(terserOptions)],
exports: "named",
sourcemap: true
}
Expand Down Expand Up @@ -88,7 +101,7 @@ const es = {
format: "es",
name: "jspdf",
sourcemap: true,
plugins: [terser({})]
plugins: [terser(terserOptions)]
}
],
external: externals,
Expand Down Expand Up @@ -117,7 +130,7 @@ const node = {
name: "jspdf",
exports: "named",
sourcemap: true,
plugins: [terser({})]
plugins: [terser(terserOptions)]
}
],
external: externals,
Expand All @@ -136,7 +149,7 @@ const umdPolyfills = {
file: "dist/polyfills.umd.js",
format: "umd",
name: "jspdf-polyfills",
plugins: [terser({})]
plugins: [terser(terserOptions)]
}
],
external: [],
Expand All @@ -159,7 +172,7 @@ const esPolyfills = {
file: "dist/polyfills.es.js",
format: "es",
name: "jspdf-polyfills",
plugins: [terser({})]
plugins: [terser(terserOptions)]
}
],
external: externals,
Expand Down
16 changes: 2 additions & 14 deletions src/libs/AtobBtoa.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
import { globalObject } from "./globalObject.js";

var atob, btoa;

(function() {
// @if MODULE_FORMAT!='cjs'
atob = globalObject.atob.bind(globalObject);
btoa = globalObject.btoa.bind(globalObject);
return;
// @endif

// @if MODULE_FORMAT='cjs'
atob = require("atob");
btoa = require("btoa");
// @endif
})();
const atob = globalObject.atob.bind(globalObject);
const btoa = globalObject.btoa.bind(globalObject);

export { atob, btoa };
1 change: 1 addition & 0 deletions src/libs/fast-png.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { decode } from "fast-png";
Loading