How to use the acorn-dynamic-import.DynamicImportKey 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 ampproject / rollup-plugin-closure-compiler / src / types.ts View on Github external
*
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS-IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import { OutputOptions, TransformSourceDescription, PluginContext, InputOptions } from 'rollup';
const dynamicImport = require('acorn-dynamic-import');

// @see https://github.com/estree/estree/blob/master/es2015.md#imports
export const IMPORT_DECLARATION = 'ImportDeclaration';
export const DYNAMIC_IMPORT_DECLARATION = dynamicImport.DynamicImportKey;
export const IMPORT_SPECIFIER = 'ImportSpecifier';
export const IMPORT_DEFAULT_SPECIFIER = 'ImportDefaultSpecifier';
export const IMPORT_NAMESPACE_SPECIFIER = 'ImportNamespaceSpecifier';

// @see https://github.com/estree/estree/blob/master/es2015.md#exports
export const EXPORT_NAMED_DECLARATION = 'ExportNamedDeclaration';
export const EXPORT_SPECIFIER = 'ExportSpecifier';
export const EXPORT_DEFAULT_DECLARATION = 'ExportDefaultDeclaration';
export const EXPORT_ALL_DECLARATION = 'ExportAllDeclaration';
export const ALL_EXPORT_DECLARATIONS = [
  EXPORT_NAMED_DECLARATION,
  EXPORT_DEFAULT_DECLARATION,
  EXPORT_ALL_DECLARATION,
];

export type Range = [number, number];
github cloudflare / ipfs-ext / node_modules / acorn-node / walk.js View on Github external
var xtend = require('xtend')
var walk = require('acorn-walk')
var dynamicImportKey = require('acorn-dynamic-import').DynamicImportKey

var base = xtend(walk.base)
base[dynamicImportKey] = function () {}

function simple (node, visitors, baseVisitor, state, override) {
  return walk.simple(node, visitors, baseVisitor || base, state, override)
}

function ancestor (node, visitors, baseVisitor, state) {
  return walk.ancestor(node, visitors, baseVisitor || base, state)
}

function recursive (node, state, funcs, baseVisitor, override) {
  return walk.recursive(node, state, funcs, baseVisitor || base, override)
}
github peterqliu / threebox / node_modules / acorn-node / walk.js View on Github external
var xtend = require('xtend')
var walk = require('acorn-walk')
var dynamicImportKey = require('acorn-dynamic-import').DynamicImportKey

var base = xtend(walk.base)
base[dynamicImportKey] = function () {}

function simple (node, visitors, baseVisitor, state, override) {
  return walk.simple(node, visitors, baseVisitor || base, state, override)
}

function ancestor (node, visitors, baseVisitor, state) {
  return walk.ancestor(node, visitors, baseVisitor || base, state)
}

function recursive (node, state, funcs, baseVisitor, override) {
  return walk.recursive(node, state, funcs, baseVisitor || base, override)
}