Skip to content

Update deployment.md with Grunt example #619

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

Merged
merged 4 commits into from
Jan 17, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions src/v2/guide/deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: プロダクション環境への配信
updated: 2017-09-08
updated: 2018-01-16
type: guide
order: 401
---
Expand Down Expand Up @@ -47,21 +47,44 @@ module.exports = {
NODE_ENV=production browserify -g envify -e main.js | uglifyjs -c -m > build.js
```

- Or, using [envify](https://github.com/hughsk/envify) with Gulp:
- もしくは、[envify](https://github.com/hughsk/envify)Gulp とともに使います:

``` js
// Use the envify custom module to specify environment variables
// 環境変数を指定するために envify のカスタムモジュールを使います
var envify = require('envify/custom')

browserify(browserifyOptions)
.transform(vueify),
.transform(
// Required in order to process node_modules files
// node_modules ファイルを処理するために必要です
{ global: true },
envify({ NODE_ENV: 'production' })
)
.bundle()
```

- もしくは、[envify](https://github.com/hughsk/envify) を Grunt と [grunt-browserify](https://github.com/jmreidy/grunt-browserify) とともに使います:

``` js
// 環境変数を指定するために envify のカスタムモジュールを使います
var envify = require('envify/custom')

browserify: {
dist: {
options: {
// grunt-browserify のデフォルトの順番から逸脱するための関数
configure: b => b
.transform('vueify')
.transform(
// node_modules ファイルを処理するために必要です
{ global: true },
envify({ NODE_ENV: 'production' })
)
.bundle()
}
}
}
```

#### Rollup

Expand Down