From f45aecb9f9181bd1a125713728c48f50f58aa4c5 Mon Sep 17 00:00:00 2001 From: john4650-hub Date: Thu, 5 Oct 2023 18:36:43 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=85transpiled=20code=20to=20support=20old?= =?UTF-8?q?=20browsers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 +++- babel.config.json | 17 +++++++++++++++++ package.json | 3 ++- sample.txt | 2 +- www/js/components/tabs/changeLog.js | 1 + 5 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 babel.config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79fc0f3..cc15cc2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,8 +15,10 @@ jobs: node-version: 16 - run: sudo npm install --save-dev webpack webpack-cli + - run: npm install --save-dev @babel/core @babel/cli @babel/preset-env - run: cd www && mkdir dist && cd .. - run: npm run build + - run: npm run babelit - run: ls - run: sudo npm install -g cordova@11.0.0 - run: sudo cordova platform add android @@ -68,7 +70,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.TK }} with: tag_name: ${{ github.run_number }} - release_name: ${{ github.event.repository.name }} v5.0.6 #release + release_name: ${{ github.event.repository.name }} v5.0.7 #release - name: upload Release Apk id: upload_release_assets diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 0000000..3f5cbe2 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,17 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "edge": "17", + "firefox": "60", + "chrome": "67", + "safari": "11.1" + }, + "useBuiltIns": "usage", + "corejs": "3.6.5" + } + ] + ] +} diff --git a/package.json b/package.json index 6606aaa..9cbacda 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "main":"./www/js/app.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "build": "webpack --config webpack.config.js" + "build": "webpack --config webpack.config.js", + "babelit":"npx babel www/dist --out-dir www/dist" }, "keywords": [ "ecosystem:cordova" diff --git a/sample.txt b/sample.txt index 13ac5cc..22ff0d4 100644 --- a/sample.txt +++ b/sample.txt @@ -1 +1 @@ -✅Now ctrl + S 5o save changes to a file you are currently editing +✅transpiled code to support old browsers diff --git a/www/js/components/tabs/changeLog.js b/www/js/components/tabs/changeLog.js index f5f664b..013cbce 100644 --- a/www/js/components/tabs/changeLog.js +++ b/www/js/components/tabs/changeLog.js @@ -18,6 +18,7 @@ let log = [{ ✅Now app can run in background ✅Prevent abrupt closure of app when using other apps `},{version:'v5.0.6',info: `✅Now ctrl + S 5o save changes to a file you are currently editing +`},{version:'v5.0.7',info: `✅transpiled code to support old browsers `} ]