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

pages[].filename not working. Is this still maintained? #144

Open
FarhanMS123 opened this issue Feb 12, 2024 · 1 comment
Open

pages[].filename not working. Is this still maintained? #144

FarhanMS123 opened this issue Feb 12, 2024 · 1 comment

Comments

@FarhanMS123
Copy link

Hi! First of all, is this still maintained? I see on the NPM, Version 3.2.* published atleast 2 months ago. But, I can't find related commit in this Github. Does it submitted by different user or has any hidden repository?

Second, I have this config:

import { defineConfig, splitVendorChunkPlugin } from 'vite'
import react from '@vitejs/plugin-react-swc'
import process from "process";
import { createHtmlPlugin } from 'vite-plugin-html'

export default defineConfig({
  plugins: [
    createHtmlPlugin({
      minify: false,
      pages: [
        {
          filename: "test/page-name.page.js.html",
          template: "src/template/clean.html",
          injectOptions: {
            data: {
              script_src: "/test/page-name.page.js"
            }
          },
        },
        {
          filename: "/test/page-name.page.tsx.html",
          template: "/src/template/clean.html",
          injectOptions: {
            data: {
              script_src: "/test/page-name.page.tsx"
            }
          },
        },
      ],
    }),
    splitVendorChunkPlugin(),
    react(),
  ],

  build: {
    rollupOptions: {
      input: {},
      external: /^(.git|.*\.local|dist|node_modules)$/ig,
    },
    outDir: "dist",
    assetsDir: "chunks",
  },

  root: process.cwd(),
  publicDir: false,
  base: "/",
});

With this src/template/clean.html:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body>
    <script type="module" src="<%- script_src %>"></script>
  </body>
</html>

But, the output is not like as I intended:
image

The clean.html should be renamed test/page-name.page.js.html and test/page-name.page.tsx.html. Is this error? Or the README.md is the error one?

@mhornbacher
Copy link
Contributor

It seems every once in a while something happens here but it is not actively maintained.

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

2 participants