Skip to content

Commit

Permalink
fix: force production env for postcss on nuxt build
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Jul 20, 2020
1 parent cdb2d9f commit 977d605
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module.exports = async function (moduleOptions) {

// This hooks is called only for `nuxt dev` and `nuxt build` commands
this.nuxt.hook('build:before', () => {
// Fix issue with postCSS that needs process.env.NODE_ENV
if (!this.options.dev && !process.env.NODE_ENV) {
process.env.NODE_ENV = 'production'
}
/*
** Set PostCSS config
*/
Expand Down

0 comments on commit 977d605

Please sign in to comment.