From 7587a7d37e480813c90bcd1675d32843fcd236d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Tue, 16 Aug 2022 11:14:24 +0800 Subject: [PATCH] cannot rebuilt dist/lexer.js, just use pure-js lexer Last-Update: 2020-11-24 Forwarded: not-needed Gbp-Pq: Name cjs-module-lexer.patch --- lib/internal/modules/esm/translators.js | 9 +-------- node.gyp | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/internal/modules/esm/translators.js b/lib/internal/modules/esm/translators.js index 12121f37..67b6cf9c 100644 --- a/lib/internal/modules/esm/translators.js +++ b/lib/internal/modules/esm/translators.js @@ -59,14 +59,7 @@ const asyncESM = require('internal/process/esm_loader'); let cjsParse; async function initCJSParse() { - if (typeof WebAssembly === 'undefined') { - cjsParse = require('internal/deps/cjs-module-lexer/lexer').parse; - } else { - const { parse, init } = - require('internal/deps/cjs-module-lexer/dist/lexer'); - await init(); - cjsParse = parse; - } + cjsParse = require('internal/deps/cjs-module-lexer/lexer').parse; } const translators = new SafeMap(); diff --git a/node.gyp b/node.gyp index 48fd7a12..580e1d8d 100644 --- a/node.gyp +++ b/node.gyp @@ -250,7 +250,6 @@ 'deps/acorn-plugins/acorn-private-methods/index.js', 'deps/acorn-plugins/acorn-static-class-features/index.js', 'deps/cjs-module-lexer/lexer.js', - 'deps/cjs-module-lexer/dist/lexer.js', ], 'node_mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)node_mksnapshot<(EXECUTABLE_SUFFIX)', 'mkcodecache_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mkcodecache<(EXECUTABLE_SUFFIX)',