vitejs / vite-plugin-vue2

Vite plugin for Vue 2.7
MIT License
543 stars 46 forks source link

Compiler options / isCustomElement not working #76

Open juhasev opened 1 year ago

juhasev commented 1 year ago

The compiler options need to be documented somewhere. I found some posts on how this is supposed to work in vue2 and vue3 plugins.

I am using the vue2 plugin, the latest version. The following configuration does nothing in the dev build.

Vue compiler throws errors for all custom components starting with <mj-

return defineConfig({

        plugins: [
            vue({
                template: {
                    transformAssetUrls: {
                        base: null,
                        includeAbsolute: false,
                    },
                    compilerOptions: {
                        isCustomElement: (tag) => tag.startsWith('mj')
                    }
                },
            }),
     ]
});

Am I doing something wrong, or is this a bug? Has anybody else had any success with the custom components like MJML?

Thanks, Juha

vignesh-uj commented 1 year ago

Does this help :

In your main.js -> Vue.config.ignoredElements = [/mj-\w*/];