vue-ast-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

vue-ast-utils

Utils for working with Vue 3 AST nodes

🙋‍♂️ Why?

Vue 3 comes with types, but ambient const enums cannot be accessed when building your project with isolatedModules:

import { NodeTypes } from '@vue/compiler-core';

console.log(NodeTypes.ATTRIBUTE === Node.type);
// ⚠️ Cannot access ambient const enums when the '--isolatedModules' flag is provided. ts(2748)

Related issue: vue-next#1228

These utils contain type checking so you don't need to import ambient types.

🚀 Install

npm i -D vue-ast-utils @vue/compiler-core

Package Sidebar

Install

npm i vue-ast-utils

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

3.36 kB

Total Files

4

Last publish

Collaborators

  • hirokiosame