0.20.0支持
這是我的幸運日。 An aurelia-cli
release from 8 hours前這樣說:
產品特點:支持包的版本號
Walkthru
首先,安裝0.20.0並創建一個新的應用程序。
npm install [email protected]">=0.20.0" -g
au new my-app
或者,升級現有的應用程序。
npm install [email protected]">=0.20.0" --save-dev
接下來,打開my-app/aurelia-project/aurelia.json
。
設置build.options.rev
屬性。
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage",
"rev": "true"
},
設置output
和index
屬性裏面的build.targets
"targets": [
{
"id": "web",
"displayName": "Web",
"output": "scripts",
"index": "index.html"
}
],
的aurelia-cli
將尋找index
文件並替換參考scripts\vendor-bundle.js
這樣的:
<script src="scripts\vendor-bundle.js" data-main="aurelia-bootstrapper">
<script src="scripts\vendor-bundle-947c308e28.js" data-main="aurelia-bootstrapper">
最後,建立應用程序。
你的包會是這個樣子:
app-bundle-e0c4d46f7d.js
vendor-bundle-dba9184d78.js
源GitHub上
cli/lib/build/bundler.js
let defaultBuildOptions = {
minify: "stage & prod",
sourcemaps: "dev & stage",
rev: false
};
cli/lib/build/bundler.js
if (buildOptions.rev) {
//Generate a unique hash based off of the bundle contents
this.hash = generateHash(concat.content);
bundleFileName = generateHashedPath(this.config.name, this.hash);
}
http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/the-aurelia-cli/10 – rball