antfu / vite-plugin-prebundle

MIT License
86 stars 6 forks source link

How to use with vue plugin? #3

Open yArna opened 1 year ago

yArna commented 1 year ago

Doesn't seem to work with the vue plugin at the moment

[ERROR] No loader is configured for ".vue" files:

vite.config.ts

import vue from "@vitejs/plugin-vue2"
import Prebundle from "vite-plugin-prebundle"

let config = {
    root: "./web",
    server: {
        port: 8899,
    },
    plugins: [
        vue(),
        Prebundle({ entries: ["./app.js"] }),
    ]
}
akaltar commented 6 months ago

Something like this almost worked for me for react:

import vue from "@vitejs/plugin-vue2"
import Prebundle from "vite-plugin-prebundle"

let config = {
    root: "./web",
    server: {
        port: 8899,
    },
    plugins: [
        vue(),
        Prebundle({ entries: [{filepath:"./app.js", bundler: 'vite', viteOptions:[vue()]}] }),
    ]
}