如何将 aurelia-animator-velocity 插件添加到基于 CLI 的项目中?
How to add aurelia-animator-velocity plugin to CLI based project?
如果元素具有 "au-animate" class 以及我配置插件的方式,则标准淡入淡出有效。但是如果 app.ts 注入了 VelocityAnimator 并且之后创建了一个新的 build,那么对于“http://localhost:9000/src/velocity.js”的 HTTP GET 请求失败,JS 错误 "Unhandled rejection Error: Script error for "velocity”,需要:velocity-animate/velocity.ui".
消息在 build 输出中重复了两次:
------- File not found or not accessible ------
| Location: <project folder>/src/velocity.js
| Requested by: <project folder>/src/app.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
项目配置为使用 Typescript。
我已经安装了 npm 包 "aurelia-animator-velocity" 和 "velocity-animate"。我尝试包含 velocity.ui,但我只是在猜测下面的操作方法。
aurelia.json
{
"name": "velocity-animate",
"path": "../node_modules/velocity-animate",
"main": "velocity"
},
{
"name": "velocity-animate-ui",
"path": "../node_modules/velocity-animate",
"main": "velocity.ui"
},
"aurelia-animator-velocity"
main.ts
aurelia.use
.standardConfiguration()
.plugin('aurelia-animator-velocity')
.feature('resources');
app.ts
import { autoinject } from "aurelia-framework";
import { VelocityAnimator } from "aurelia-animator-velocity";
@autoinject
export class App {
constructor(private animator: VelocityAnimator) {
console.log(this.animator);
}
}
我找到了 the workaround。还有,额外的字符。
如果元素具有 "au-animate" class 以及我配置插件的方式,则标准淡入淡出有效。但是如果 app.ts 注入了 VelocityAnimator 并且之后创建了一个新的 build,那么对于“http://localhost:9000/src/velocity.js”的 HTTP GET 请求失败,JS 错误 "Unhandled rejection Error: Script error for "velocity”,需要:velocity-animate/velocity.ui".
消息在 build 输出中重复了两次:
------- File not found or not accessible ------
| Location: <project folder>/src/velocity.js
| Requested by: <project folder>/src/app.js
| Is this a package? Make sure that it is configured in aurelia.json and that it is not a Node.js package
项目配置为使用 Typescript。 我已经安装了 npm 包 "aurelia-animator-velocity" 和 "velocity-animate"。我尝试包含 velocity.ui,但我只是在猜测下面的操作方法。
aurelia.json
{
"name": "velocity-animate",
"path": "../node_modules/velocity-animate",
"main": "velocity"
},
{
"name": "velocity-animate-ui",
"path": "../node_modules/velocity-animate",
"main": "velocity.ui"
},
"aurelia-animator-velocity"
main.ts
aurelia.use
.standardConfiguration()
.plugin('aurelia-animator-velocity')
.feature('resources');
app.ts
import { autoinject } from "aurelia-framework";
import { VelocityAnimator } from "aurelia-animator-velocity";
@autoinject
export class App {
constructor(private animator: VelocityAnimator) {
console.log(this.animator);
}
}
我找到了 the workaround。还有,额外的字符。