How to use the acorn-dynamic-import.default 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 ColdDay / touchRobot / node_modules / webpack / lib / Parser.js View on Github external
Author Tobias Koppers @sokra
*/
"use strict";

// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API

const acorn = require("acorn");
const acornDynamicImport = require("acorn-dynamic-import").default;
const { Tapable, SyncBailHook, HookMap } = require("tapable");
const util = require("util");
const vm = require("vm");
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
const StackedSetMap = require("./util/StackedSetMap");
const TrackingSet = require("./util/TrackingSet");

const acornParser = acorn.Parser.extend(acornDynamicImport);

const joinRanges = (startRange, endRange) => {
	if (!endRange) return startRange;
	if (!startRange) return endRange;
	return [startRange[0], endRange[1]];
};

const defaultParserOptions = {
	ranges: true,
	locations: true,
	ecmaVersion: 2019,
	sourceType: "module",
	onComment: null
};

// regexp to match at lease one "magic comment"
github flaviuse / mern-authentication / client / node_modules / webpack / lib / Parser.js View on Github external
Author Tobias Koppers @sokra
*/
"use strict";

// Syntax: https://developer.mozilla.org/en/SpiderMonkey/Parser_API

const acorn = require("acorn");
const acornDynamicImport = require("acorn-dynamic-import").default;
const { Tapable, SyncBailHook, HookMap } = require("tapable");
const util = require("util");
const vm = require("vm");
const BasicEvaluatedExpression = require("./BasicEvaluatedExpression");
const StackedSetMap = require("./util/StackedSetMap");
const TrackingSet = require("./util/TrackingSet");

const acornParser = acorn.Parser.extend(acornDynamicImport);

const joinRanges = (startRange, endRange) => {
	if (!endRange) return startRange;
	if (!startRange) return endRange;
	return [startRange[0], endRange[1]];
};

const defaultParserOptions = {
	ranges: true,
	locations: true,
	ecmaVersion: 2019,
	sourceType: "module",
	onComment: null
};

// regexp to match at lease one "magic comment"