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

Not working when using other directory for html's #118

Open
kiyoshi-satoo opened this issue May 22, 2023 · 1 comment
Open

Not working when using other directory for html's #118

kiyoshi-satoo opened this issue May 22, 2023 · 1 comment

Comments

@kiyoshi-satoo
Copy link

kiyoshi-satoo commented May 22, 2023

This is project simple strcuture

image

 plugins: [
      createHtmlPlugin({
        pages: [
          {
            filename: "index.html",
            template: "src/templates/index.html",
            injectOptions: {
              data: {
                title: "index",
                injectScript: `<script src="./inject.js"></script>`,
              },
              tags: [
                {
                  injectTo: "body-prepend",
                  tag: "div",
                  attrs: {
                    id: "tag1",
                  },
                },
              ],
            },
          },
        ],
      }),
    ],
  };

Looks like the project is no longer maintained.

@kiyoshi-satoo kiyoshi-satoo changed the title Not working when using other directory for html Not working when using other directory for htmls May 22, 2023
@kiyoshi-satoo kiyoshi-satoo changed the title Not working when using other directory for htmls Not working when using other directory for html's May 22, 2023
@ThornWalli
Copy link

Hello @kiyoshi-satoo ,

you have to put something in the property here. build.rollupOptions.input

function isMpa(viteConfig: ResolvedConfig) {
const input = viteConfig?.build?.rollupOptions?.input ?? undefined
return typeof input !== 'string' && Object.keys(input || {}).length > 1
}

Otherwise ignore the case.

Unfortunately, the topic is a bit bigger, I once created a PR for the topic.

#127

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