How to use the vue-template-compiler/package.json.homepage function in vue-template-compiler

To help you get started, we’ve selected a few vue-template-compiler 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 fkling / astexplorer / website / src / parsers / html / vue.js View on Github external
import defaultParserInterface from '../utils/defaultParserInterface';
import pkg from 'vue-template-compiler/package.json';

const ID = 'vue';

export default {
  ...defaultParserInterface,

  id: ID,
  displayName: ID,
  version: pkg.version,
  homepage: pkg.homepage,
  locationProps: new Set(['start', 'end']),
  typeProps: new Set(['tag']),

  loadParser(callback) {
    require(['vue-template-compiler/browser'], callback);
  },

  parse(parser, code, options) {
    return parser.compile(code, options).ast;
  },

  nodeToRange(node) {
    if (node.type || node.name) {
      return [node.start, node.end];
    }
  },