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

Is there a way to define the name of output HTML files? #29

Open
emosheeep opened this issue Sep 15, 2022 · 3 comments
Open

Is there a way to define the name of output HTML files? #29

emosheeep opened this issue Sep 15, 2022 · 3 comments

Comments

@emosheeep
Copy link

emosheeep commented Sep 15, 2022

Hi there! The name of output html files seems too nested like output/${pageName}/inde.html, I want it to be like ${pageName}.html or some else, so I wrote a simple plugin, but it’s troublesome. I think it would be convenient if this feature can be built in.

{
  name: 'rename-multi-entry-name',
  enforce: 'post',
  apply: 'build',
  closeBundle() {
    readdirSync('src/modules').forEach(name => {
      renameSync(`output/${name}/index.html`, `output/${name}.html`);
      rmdirSync(`output/${name}`);
    });
  },
},
@lzq035
Copy link

lzq035 commented Nov 12, 2022

这样好像会有问题,访问页面必须得有html后缀,除非服务端做处理

@emosheeep
Copy link
Author

这样好像会有问题,访问页面必须得有html后缀,除非服务端做处理

https://github.com/emosheeep/vite-plugin-virtual-mpa

可以试下我这个,把作者的那个html和mpa两个插件融合起来了,然后自定义输出文件路径也是ok的。然后也是纯Ts写的,配置提示和使用体验非常友好

@IndexXuan
Copy link
Owner

嵌套页面个人不是很喜欢,有需求的可以自己搞下~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants