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

feat: expose config in afterBuild event #1047

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

cossssmin
Copy link
Member

@cossssmin cossssmin commented Aug 3, 2023

This PR exposes the config object as the second parameter of the afterBuild event function, so you can read it like this:

// config.production.js
module.exports = {
  // ...
  events: {
    afterBuild(files, config) {
      const env = config.env

	  // do stuff with env
	}
  }
}

@cossssmin cossssmin merged commit b4c1845 into master Aug 3, 2023
3 checks passed
@Hahlh
Copy link

Hahlh commented Aug 6, 2023

Should afterBuild also trigger for the node API?
I am struggling to ensure that the build that has happened is really a production build as I am still finding Tailwind CSS vars in the output.

@cossssmin
Copy link
Member Author

cossssmin commented Aug 6, 2023

The equivalent for afterBuild in Node is afterTransformers, that event runs last when using Maizzle programmatically.

@cossssmin cossssmin deleted the afterbuild-config branch December 29, 2023 14:29
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.

2 participants