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