Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report]: v2 transform vue ext file error #2034

Open
ErKeLost opened this issue Dec 31, 2024 · 0 comments
Open

[Bug Report]: v2 transform vue ext file error #2034

ErKeLost opened this issue Dec 31, 2024 · 0 comments
Labels
enhancement New feature or request v2.0 v2.0 version

Comments

@ErKeLost
Copy link
Member

ErKeLost commented Dec 31, 2024

Steps to reproduce

branch: v2-dev,
example: vue3 example use unplugin-vue
run : pnpm dev

Reproduce link

No response

What is actually happening?

not transform app.vue

so we can manually load the vue file and return the content

This problem involves the problem that hooks will not execute when the cache is opened. It should be a general problem

when use unplugin-vue

import { defineConfig } from "@farmfe/core";
// import Vue from "unplugin-vue/farm";
import Vue from "@vitejs/plugin-vue";
import fs from 'fs'

export default defineConfig({
  // plugins: [Vue(),base()],
  vitePlugins: [Vue()],
  compilation: {
    progress:false,
    persistentCache: false,
  },
  server: {
    origin: "http://localhost:9000"
  }
});

function base() {
  return {
    name: "farm-load-vue-module-type",
      priority: -100,
      load: {
        filters: {
          resolvedPaths: [".vue"],
        },
        executor: (param) => {
          const content = fs.readFileSync(param.resolvedPath, "utf-8");
          return {
            content,
            moduleType: "js",
          };
        },
      },
  };
}

System Info

mac
@ErKeLost ErKeLost changed the title [Bug Report]: transform vue ext file error [Bug Report]: v2 transform vue ext file error Dec 31, 2024
@ErKeLost ErKeLost added v2.0 v2.0 version enhancement New feature or request labels Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v2.0 v2.0 version
Projects
None yet
Development

No branches or pull requests

1 participant