From ef9c5907803613f519369fe834e36c7892a0bbe1 Mon Sep 17 00:00:00 2001 From: Stefan Grund Date: Wed, 10 Jan 2018 18:32:33 +0100 Subject: [PATCH] Update deployment.md with Grunt example (#1375) --- src/v2/guide/deployment.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/v2/guide/deployment.md b/src/v2/guide/deployment.md index 9807cb2069..e6dc44bdca 100644 --- a/src/v2/guide/deployment.md +++ b/src/v2/guide/deployment.md @@ -61,6 +61,29 @@ module.exports = { ) .bundle() ``` + +- Or, using [envify](https://github.com/hughsk/envify) with Grunt and [grunt-browserify](https://github.com/jmreidy/grunt-browserify): + + ``` js + // Use the envify custom module to specify environment variables + var envify = require('envify/custom') + + browserify: { + dist: { + options: { + // Function to deviate from grunt-browserify's default order + configure: b => b + .transform('vueify') + .transform( + // Required in order to process node_modules files + { global: true }, + envify({ NODE_ENV: 'production' }) + ) + .bundle() + } + } + } + ``` #### Rollup