Skip to content

Commit d1a713b

Browse files
authored
Navigator: Improve backward compatibility of scripts (#62)
1 parent 9443a99 commit d1a713b

File tree

9 files changed

+1179
-10
lines changed

9 files changed

+1179
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ All notable changes to this project will be documented in this file. Take a look
3737
* Fixed turning pages of an EPUB reflowable resource with an odd number of columns. A virtual blank trailing column is appended to the resource when displayed as two columns.
3838
* EPUB: Fallback on `reflowable` if the `presentation.layout` hint is missing from a manifest.
3939
* EPUB: Offset of the current selection's `rect` to take into account the vertical padding.
40+
* Improve backward compatibility of JavaScript files using Babel.
4041
4142
4243
## [2.1.1]

readium/navigator/src/main/assets/_scripts/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
},
66
"globals": {
77
"Android": "readonly",
8+
"global": "writable",
89
"readium": "writable"
910
},
1011
"extends": "eslint:recommended",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

readium/navigator/src/main/assets/_scripts/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "readium-js",
3+
"author": "Readium Foundation",
34
"version": "0.1.0",
5+
"license": "BSD-3-Clause",
46
"description": "A set of scripts for the EPUB navigator",
57
"private": true,
68
"scripts": {
@@ -9,9 +11,11 @@
911
"checkformat": "prettier --check '**/*.js'",
1012
"format": "prettier --list-different --write '**/*.js'"
1113
},
12-
"author": "Readium Foundation",
13-
"license": "BSD-3-Clause",
14+
"browserslist": [ "Android >= 4" ],
1415
"devDependencies": {
16+
"@babel/core": "^7.16.0",
17+
"@babel/preset-env": "^7.16.0",
18+
"babel-loader": "^8.2.3",
1519
"eslint": "^7.29.0",
1620
"prettier": "2.3.1",
1721
"webpack": "^5.40.0",

readium/navigator/src/main/assets/_scripts/webpack.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,18 @@ module.exports = {
1111
filename: "readium-[name].js",
1212
path: path.resolve(__dirname, "../readium/scripts"),
1313
},
14+
module: {
15+
rules: [
16+
{
17+
test: /\.m?js$/,
18+
exclude: /node_modules/,
19+
use: {
20+
loader: "babel-loader",
21+
options: {
22+
presets: ["@babel/preset-env"],
23+
},
24+
},
25+
},
26+
],
27+
},
1428
};

readium/navigator/src/main/assets/_scripts/yarn.lock

Lines changed: 1151 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.map

readium/navigator/src/main/assets/readium/scripts/readium-fixed.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readium/navigator/src/main/assets/readium/scripts/readium-reflowable.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)