-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
27 additions
and
0 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,24 @@ | |||
const fs = require('fs') | |||
const wasmImportString = "import * as wasm from './js_chain_libs_bg.wasm';" | |||
const chainLibsPath = 'node_modules/@emurgo/js-chain-libs/js_chain_libs.js' | |||
|
|||
const removeChainLibsWasmImport = () => { | |||
fs.readFile(chainLibsPath, 'utf8', (err, data) => { | |||
if (err) throw err | |||
const splitArray = data.toString().split('\n') | |||
if (splitArray[0] === wasmImportString) { | |||
splitArray.splice(splitArray.indexOf(wasmImportString), 1) | |||
const result = splitArray.join('\n') | |||
fs.writeFile(chainLibsPath, result, (err) => { | |||
if (err) throw err | |||
}) | |||
// eslint-disable-next-line no-console | |||
console.log('Removed wasm import from js-chain-libs.') | |||
} else { | |||
// eslint-disable-next-line no-console | |||
console.log('Wasm import not found.') | |||
} | |||
}) | |||
} | |||
|
|||
module.exports = removeChainLibsWasmImport |
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