How to use the acorn-dynamic-import/src/index function in acorn-dynamic-import

To help you get started, we’ve selected a few acorn-dynamic-import examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chjj / bpkg / etc / acorn-wrap / index.js View on Github external
'use strict';

const acorn = require('acorn');
const walk = require('acorn-walk');

const Parser = acorn.Parser.extend(
  require('acorn-bigint'),
  require('acorn-export-ns-from'),
  require('acorn-dynamic-import/src/index')['default'],
  require('acorn-import-meta')
);

walk.base.Import = (node, st, c) => {};

acorn.parse = Parser.parse.bind(Parser);
acorn.parseExpressionAt = Parser.parseExpressionAt.bind(Parser);
acorn.tokenizer = Parser.tokenizer.bind(Parser);
acorn.walk = walk;

module.exports = acorn;