webdiscus / pug-loader

Pug loader for Webpack renders pug to HTML or template function
https://webdiscus.github.io/pug-loader/pug-filters
ISC License
69 stars 5 forks source link

Doesn't fix indent pug with @webdiscus/pug-loader on nuxt 3 (vite) #28

Closed Maksym220066 closed 11 months ago

Maksym220066 commented 11 months ago

If i have indent after template with pug lang i get error this

  > 2|   WrapperGlobal
> -------^
>     3|     v-container.fill-height
>     4|       h1
>     5|       |  {{ error }}

and i found fix this by @webdiscus/pug-loader and this didn't help me. mb i set config incorrect?

  1. install that 2.set config in nuxt.config.ts
import vuetify from 'vite-plugin-vuetify'
import eslintPlugin from 'vite-plugin-eslint'
import svgLoader from 'vite-svg-loader'

export default defineNuxtConfig({
    ssr: true,
    generate: {
        dir: 'dist',
        subFolders: false
    },
    modules: [
        '@pinia/nuxt',
    ],
    css: [
        'vuetify/lib/styles/main.sass',
        '@mdi/font/css/materialdesignicons.min.css',
        'assets/sass/main.sass'
    ],
    build: {
        transpile: ['vuetify'],
    },
    app: {
        head: {
            title: 'Certification Personal Account',
        }
    },
    plugins: ['~/plugins/core.js'],
    vite: {
        build: {
            transpile: ['@webdiscus/pug-loader'],
        },
        define: {
            __VUE_I18N_FULL_INSTALL__: true,
            __VUE_I18N_LEGACY_API__: false,
            __INTLIFY_PROD_DEVTOOLS__: false
        },
        plugins: [
            eslintPlugin(),
            svgLoader(),
        ]
    }
})
webdiscus commented 11 months ago

Hi @Maksym220066,

ah, I'm sorry, I did not see the word Vita. This loader works only under Webpack, sorry for confusion :-(

Maksym220066 commented 11 months ago

But in future will be work with vite?

webdiscus commented 11 months ago

currently I don't have a plane for support the Vite, because I don't have a project that uses Vite. But in the future I might do it when I have a Vite project.