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

Use the build:compiled hook for nuxt 2 compatibility, fixes #12 #228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jonathanselander
Copy link

Apparently the generate:done hook doesn't (at least not for me) always run when i build nuxt 2 projects. build:compiled seems to do the trick

@jonathanselander jonathanselander changed the title Use the build:compiled for nuxt 2 compatibility, fixes #12 Use the build:compiled hook for nuxt 2 compatibility, fixes #12 Jan 17, 2023
@@ -99,7 +99,7 @@ export default defineNuxtModule<ModuleOptions>({
if (isNuxt3()) return

// @ts-expect-error TODO: use @nuxt/bridge-schema
nuxt.hook('generate:done', async () => {
nuxt.hook('build:compiled', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was correct for generating a site. We need to add an additional hook for building, which probably would be copying the lib files into static, which isn't ideal 🤔

Suggested change
nuxt.hook('build:compiled', async () => {
nuxt.hook('generate:done', async () => {

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

Successfully merging this pull request may close these issues.

None yet

2 participants