-
Notifications
You must be signed in to change notification settings - Fork 11
1.x configuration env
ローカル版、開発版、リリース版と言った環境別に設定を分けて管理するための 名前 です。
[env].jsonは、local.json, develop.json, product.json といったふうに複数作る事で、環境別の差異を設定ファイルで分離します。
{
"app": {
"stat": {
"compress": true,
"port": 1109,
"header": {
"Access-Control-Allow-Origin" : "*",
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Allow-Headers": "*"
},
"include": {
"path": "./local",
"from": null
},
"basic": {
"use": true,
"id": "beez",
"pass": "foundation"
}
},
"mock": {
"use": true,
"compress": true,
"port": 1121,
"header": {
"Access-Control-Allow-Origin" : "*",
"Access-Control-Allow-Methods": "GET, OPTIONS",
"Access-Control-Allow-Headers": "*"
},
"include": {
"path": "./mockdata",
"from": null
},
"basic": {
"use": false
}
},
"operation": [
{ "target": "build", "comment": "grunt build" },
{ "target": "deploy", "comment": "grunt deploy" },
{ "target": "default", "comment": "grunt default" },
{ "target": "jshint", "comment": "grunt jshint" },
{ "target": "clean", "comment": "grunt clean" },
{ "target": "docs", "comment": "grunt docs" }
]
},
"stats": {
"tmp": {
"path": "/tmp",
"from": null
}
},
"bootstrap": {
"html": [ "*/index/index.html.hbs" ], // "[env][key].html" files match the pattern
"datamain": [ "*/index/require.beez.js.hbs", "*/tutorial/require.beez.js.hbs" ] // "beez.require.[env][key].js" files match the pattern
},
"stylus": {
"options": {
"encode": "utf-8",
"compress": true,
"firebug": false,
"linenos": false,
"nib": true, // stylus nib on/of
"url": {}, // @see http://learnboost.github.io/stylus/docs/functions.url.html
"fn": {} // variable that can be used with stylus file
},
"extend": { // Overwrite the case of mobile data
"condition": {
"ua": [ "android", "ios" ]
},
"content": {
"options": {}
}
}
},
"image": {
"options": {
"baseRatio": 2,
"ratios": [ 1, 1.5, 2, 3 ],
"extnames": [ ".png" ],
"include": [],
"exclude": [],
"separator": "-"
}
},
"sprite": {
"options": {
"ratios": [ 1, 1.3, 1.5, 2 ],
"extnames": [ ".png", ".jpg" ],
"heads": [ "sprite", "_sprite" ],
"separator": "-"
}
},
"deploy": {
"optipng": {
"use": true,
"options": "-o 2"
},
"jpegoptim": {
"use": true,
"options": "--strip-all"
},
"pngquant": {
"use": false,
"options": "--ext .png -f -v"
},
"include": [ "dist/*/index.js", "dist/index/require.beez.*.js", "*.html", "*.css", "*.png", "*.jpg", "*.gif", "*.ttf", "*.eot", "*.woff" ],
"exclude": [ "_*.css", "_*.png", "_*.jpg", "_*.gif", "_*.ttf", "_*.eot", "_*.woff" ]
},
"ignore": {
"include": [],
"exclude": []
}
}
開発Webサーバ設定情報
GZIP圧縮可否
開発WebサーバのListenポート番号
#### header
開発WebサーバからのHTTP Response header に追記するヘッダー情報リスト
[key].json を探すベースディレクトリパス
ベーシック認証設定
path
相対パス、絶対パスが指定可能
from
node.js resolve 関数を参照
モックサーバ設定情報
GZIP圧縮可否
モックサーバのListenポート番号
#### header
モックサーバからのHTTP Response header に追記するヘッダー情報リスト
モックデータ定義JSONファイル を探すベースディレクトリパス
path
相対パス、絶対パスが指定可能
from
node.js resolve 関数を参照
「開発Webサーバ」 -> 「Operation」画面で選択できる「grunt」コマンドの情報リスト
gruntコマンドの引数(target)
画面に表示するコマンドの説明
開発Webサーバから配信したいローカルディレクトリ情報
path
相対パス、絶対パスが指定可能
from
node.js resolve 関数を参照
keyの
tmpと pathの末尾のディレクトリ名は一致させる必要があります。
"stats": {
"tmp": {
"path": "/tmp",
"from": null
}
},
テンプレートHTMLファイルのパスのマッチパターン
デフォルトでは、s/index/index.html.hbs に配置されていますが、別のフォルダに配置したい場合や、複数テンプレートHTMLファイルを配置したい場合に利用します。
生成される[env][key].html はhbsファイルと同一フォルダに作成されます。
require.js#data-mainファイルのパスのマッチパターン
デフォルトでは、s/index/require.beez.js.hbs に配置されていますが、別フォルダに配置したい場合や、複数パターンのファイルを配置する場合に利用します。
生成されるrequire.beez.[env][key].js はhbsファイルと同一フォルダに作成されます。
Beez, Beez Foundation で使用するStylusライブラリの設定情報
開発Webサーバの自動コンパイル及び、ビルド時のコンパイルで使用されます。
Stylusファイルの文字コード
@see: http://learnboost.github.io/stylus/docs/executable.html
コンパイル時の圧縮可否
@see: http://learnboost.github.io/stylus/docs/executable.html
firebug plugin 可否
@see: http://learnboost.github.io/stylus/docs/executable.html
@see: http://learnboost.github.io/stylus/docs/executable.html
nib 利用可否
@see: http://learnboost.github.io/stylus/docs/functions.url.html
stylusファイル内で利用できる変数 variable that can be used with stylus file
fn: {
"service": "NAME"
}
特定のUserAgentの場合に、stylus.options を上書きする情報
"extend": { // Overwrite the case of mobile data
"condition": {
"ua": [ "android", "ios" ]
},
"content": {
"options": {}
}
}
開発Webサーバでは、自動コンパイル時に上書きされる ビルドでは、無効な設定
上書きする条件
UserAgentのみサポート
stylus.options に上書きするデータ
指定された画像ファイルの画像処理の設定情報
開発Webサーバ と ビルド両方で使用されます。
対象画像の Pixelratio 値
baseRatioで設定した Pixelratio 値以外で画像リサイズしたい Pixelratio 値
画像処理するファイルの拡張子
リサイズをするファイル名 or ディレクトリ パス
"include": [ "s/hoge/img", "s/foo/bar.png" ],
リサイズをしないファイル名 or ディレクトリ パス
リサイズしたファイル名に使用する、リサイズ前のファイル名とratio値の接続文字
defualt) '-'
パターンにマッチした複数の画像ファイルを Sprite 画像にまとめ、合わせてStylusファイルを同一フォルダに生成
生成するsprite sheetのratio 値
sprite sheetのpartsとなる画像の対象拡張子
sprite sheetの元画像パーツの画像ファイル名の接頭子
画像ファイル名の head や ratio の接続文字
デプロイする際に使用する設定情報
- use
trueにすることでoptipngコマンドを利用して画像圧縮行う - options
optipngコマンド実行時に用いるオプション
- use
trueにすることでjpegoptimコマンドを利用して画像圧縮行う - options
jpegoptimコマンド実行時に用いるオプション
- use
trueにすることでpngquantコマンドを利用して画像圧縮行う - options
pngquantコマンド実行時に用いるオプション
パレットを256にするので、画像により見栄えが劣化する可能性があります。
デプロイするファイルパターン
デプロイしないファイルパターン
release ディレクトリから除外する設定情報
除外するファイルパターン
除外しないファイルパターン