diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1bdc863..ef36174 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,9 +43,7 @@ jobs: node-version: "14" - name: Install Dependencies - run: | - npm ci - npm run fix-compatibility + run: npm ci - name: Build env: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 8d91e54..d8ce703 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -17,9 +17,7 @@ jobs: node-version: "14" - name: Install Dependencies - run: | - npm ci - npm run fix-compatibility + run: npm ci - name: Build Legacy env: diff --git a/package.json b/package.json index 9d73f93..501329d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "serve": "vue-cli-service serve", "build": "vue-cli-service build", "test": "jest", - "fix-compatibility": "node ./src/fix-compatibility.js", "make-extension": "node ./make-extension.js" }, "dependencies": { diff --git a/src/fix-compatibility.js b/src/fix-compatibility.js deleted file mode 100644 index 888fc29..0000000 --- a/src/fix-compatibility.js +++ /dev/null @@ -1,25 +0,0 @@ -//TODO: Use other method to fix this -// !! Only Temporary Solution -// it seems like that @babel/plugin-proposal-object-rest-spread not working -// to fix up the compatibility for Edge 18 and some older Chromium -// now manually edit the dependency files - -const fs = require('fs'); -const filePath = "./node_modules/file-type/core.js"; -const regReplace = /{\s*([a-zA-Z0-9:,\s]*),\s*\.\.\.([a-zA-Z0-9]*)\s*};/m; -if (fs.existsSync(filePath)) { - console.log("File Found!"); - let data = fs.readFileSync(filePath).toString(); - const regResult = regReplace.exec(data); - if (regResult != null) { - data = data.replace(regResult[0], - "Object.assign({ " + regResult[1] + " }, " + regResult[2] + ");" - ); - fs.writeFileSync(filePath, data); - console.log("Object rest spread in file-type fixed!"); - } else { - console.log("No fix needed."); - } -} else { - console.log("File Not Found!"); -}