lepu-test-platform-web/node_modules/acorn-dynamic-import
zhangbo db3ebd0df0 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
..
lib 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
node_modules 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
src 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
CHANGELOG.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
LICENSE 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
README.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
package.json 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00

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

You can use this module directly in order to get Acorn instance with plugin installed:

import acorn from 'acorn-dynamic-import';
// or...
const acorn = require('acorn-dynamic-import').default;

Or you can use inject.js for injecting plugin into your own version of Acorn like this:

const acorn = require('acorn-dynamic-import/lib/inject').default(require('./custom-acorn'));

Then, use the plugins option whenever you need to support dynamicImport while parsing:

const ast = acorn.parse(code, {
  plugins: { dynamicImport: true }
});

License

This plugin is issued under the MIT license.