Giter VIP home page Giter VIP logo

vue-pug-plugin's Issues

Integration with eslint

Is there a eslint plugin to allow this new syntax?

I'm getting errors like:
ESLint: Using pug each loops is forbidden.(vue-pug/no-pug-control-flow)

Volar support

Unsupported correct? I don't see where to inject this plugin and they depend on sourcemaps anyway.

Error `plugin[name] is not a function` encountered when building with Vite/Vue3/Pug3

Hi, I'm having trouble getting this plugin to work. I'm packaging my app with Vite and followed the instructions on how to add the plugin. Whenever I try to run the dev server or build, I get the error that "plugin[name]" is not a function, and I confess I'm too inexperienced with the platform to say exactly why.

My Vite config is very simple, not too different from the example except that I'm using Typescript and ES Modules, neither of which seem like they should interfere with this.

import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import * as vuePugPlugin from "vue-pug-plugin";

export default defineConfig({
  root: "./src",
  build: {
    outDir: "../dist",
    emptyOutDir: true
  },
  plugins: [
    vue({
      template: {
        preprocessOptions: {
          plugins: [{
              preCodeGen: vuePugPlugin
            }]
        }
      }
    })
  ]
});

The error I get is the following:

[plugin:vite:vue] plugin[name] is not a function

/src/components/Expansion.vue
    at /node_modules/pug/lib/index.js:45:39
    at Array.reduce (<anonymous>)
    at applyPlugins (/node_modules/pug/lib/index.js:44:18)
    at compileBody (/node_modules/pug/lib/index.js:198:9)
    at Object.exports.compile (/node_modules/pug/lib/index.js:269:16)
    at /node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:2317:58
    at /node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:1439:5
    at new Promise (<anonymous>)
    at promisify (/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:1432:10)
    at Function.exports.pug.render (/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js:2302:10

Sorry, I know this is an old project and I understand if it's not being supported, but I would appreciate any insight on this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.