mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Fixing require to be ignored by Webpack (#2115)
* Fixing require to be ignored by Webpack * Making the module.require even more dynamic, to trick Webpack
This commit is contained in:
parent
6d61cd8b76
commit
7bee6a8c19
@ -1251,7 +1251,7 @@ impl<'a> Context<'a> {
|
|||||||
self.global(&format!(
|
self.global(&format!(
|
||||||
"
|
"
|
||||||
const l{0} = typeof {0} === 'undefined' ? \
|
const l{0} = typeof {0} === 'undefined' ? \
|
||||||
require('util').{0} : {0};\
|
(0, module.require)('util').{0} : {0};\
|
||||||
",
|
",
|
||||||
s
|
s
|
||||||
));
|
));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as wasm from './reference_test_bg.wasm';
|
import * as wasm from './reference_test_bg.wasm';
|
||||||
|
|
||||||
const lTextDecoder = typeof TextDecoder === 'undefined' ? require('util').TextDecoder : TextDecoder;
|
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
||||||
|
|
||||||
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as wasm from './reference_test_bg.wasm';
|
import * as wasm from './reference_test_bg.wasm';
|
||||||
|
|
||||||
const lTextDecoder = typeof TextDecoder === 'undefined' ? require('util').TextDecoder : TextDecoder;
|
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
||||||
|
|
||||||
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ function getStringFromWasm0(ptr, len) {
|
|||||||
|
|
||||||
let WASM_VECTOR_LEN = 0;
|
let WASM_VECTOR_LEN = 0;
|
||||||
|
|
||||||
const lTextEncoder = typeof TextEncoder === 'undefined' ? require('util').TextEncoder : TextEncoder;
|
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
||||||
|
|
||||||
let cachedTextEncoder = new lTextEncoder('utf-8');
|
let cachedTextEncoder = new lTextEncoder('utf-8');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user