Giter VIP home page Giter VIP logo

Comments (9)

Tempystral avatar Tempystral commented on June 27, 2024 1

I can confirm it works, just had to make sure I was installing the new version. Thanks a million.

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

The project is being supported, I still use it actively. This is likely due to the fact the package doesnt export an ES module, only CommonJS. I will investigate

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

@Tempystral Okay it turns out you are just using the import statement incorrectly. The following should do the trick:

import vuePugPlugin from 'vue-pug-plugin'

from vue-pug-plugin.

Tempystral avatar Tempystral commented on June 27, 2024

Interesting, I had tried that as well and it didn't seem to be working, but I will investigate further on my end. I'll update later if I have more information -- thanks!

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

Im using it with that syntax in a vite/vue3 project successfully. ES6/TS projects should be able to import CommonJS modules default exports like that with no issues

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

I have updated my test project and am now seeing the same issue. Perhaps something has changed in vite or pug packages since last time I tested it.

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

Actually nevermind @Tempystral - it was due to me updating to version 2.0.0 of this plugin, in which I changed the syntax.

I would recommend you doing the same, updating to version 2.0.0 changing your code to the following

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

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

from vue-pug-plugin.

Tempystral avatar Tempystral commented on June 27, 2024

I'll give that a try, thanks. I'll let you know the result when I have a moment to sit down and test.

from vue-pug-plugin.

matthewjumpsoffbuildings avatar matthewjumpsoffbuildings commented on June 27, 2024

@Tempystral you're welcome

from vue-pug-plugin.

Related Issues (3)

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.