forked from commenthol/serialize-to-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip native functions in search. It tried to run the Array.push metho…
…d on the blueprint website.
- Loading branch information
1 parent
b53727c
commit 5099aaa
Showing
8 changed files
with
1,085 additions
and
924 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import fs from 'fs'; | ||
import utils from './src/internal/utils.js' | ||
|
||
let distJavaScript = fs.readFileSync('./dist/main.js', 'utf8'); | ||
|
||
const regex = new RegExp("_internal_utils_js__WEBPACK_IMPORTED_MODULE_0__.default.world.(\\w+ ?= ?\\w+)(\\r?\\n)", "gm") | ||
const replace = "_internal_utils_js__WEBPACK_IMPORTED_MODULE_0__.default.world.$1;$2capture.$1;$2" | ||
|
||
distJavaScript = distJavaScript.replaceAll(regex, replace) | ||
|
||
let popupJavaScript = fs.readFileSync('./serialise-to-js-addon/popup.js', 'utf8'); | ||
|
||
const dollarNumb = 'dollar' + new Date().toISOString() // Avoids issue with self referencing | ||
distJavaScript = distJavaScript.replaceAll("$", dollarNumb) | ||
const regexBetweenTokens = new RegExp("(/// BEGIN of modified main.js\\r?\\n)[\\s\\S]*?(\\r?\\n\\s+/// END of modified main.js)", "gm") | ||
popupJavaScript = popupJavaScript.replace( | ||
regexBetweenTokens, | ||
"$1" + distJavaScript + "$2" | ||
) | ||
popupJavaScript = popupJavaScript.replaceAll(dollarNumb, "$") | ||
|
||
fs.writeFileSync('./serialise-to-js-addon/popup.js', popupJavaScript, 'utf8'); | ||
console.log("build_addon.js done") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.