No description, website, or topics provided.
Clone or download
Jordan Gensler
Jordan Gensler Updated
Latest commit 14d4b20 Oct 1, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Fixing travis Oct 1, 2018
test Port to Acorn 6 plugin API Sep 11, 2018
.babelrc Initial (non-functional) plugin Nov 22, 2016
.eslintignore Initial (non-functional) plugin Nov 22, 2016
.eslintrc Initial (non-functional) plugin Nov 22, 2016
.gitignore Adds walk support Jan 11, 2018
.npmignore Initial (non-functional) plugin Nov 22, 2016
.travis.yml Fixing travis Oct 1, 2018
CHANGELOG.md v4.0.0 Oct 1, 2018
LICENSE Initial (non-functional) plugin Nov 22, 2016
README.md Updated Oct 1, 2018
package-lock.json Updated Oct 1, 2018
package.json v4.0.0 Oct 1, 2018

README.md

Dynamic import support in acorn

This is plugin for Acorn - a tiny, fast JavaScript parser, written completely in JavaScript.

For more information, check out the proposal repo.

Usage

Importing this module gives you a plugin that can be used to extend an Acorn parser:

import Parser from 'acorn';
import dynamicImport from 'acorn-dynamic-import';

Parser.extend(dynamicImport).parse('import("something");');

To extend the AST walker for dynamic imports, you can injecting the new node type into acorn-walk like this:

import inject from 'acorn-dynamic-import/lib/walk';
import * as acornWalk from 'acorn-walk';

const walk = inject(acornWalk);

License

This plugin is issued under the MIT license.