0
votes

Standard fade works if an element has "au-animate" class with the way I configured the plugin. But if app.ts injects VelocityAnimator and a new build is made after that, then there is failed HTTP GET request for "http://localhost:9000/src/velocity.js", JS error "Unhandled rejection Error: Script error for "velocity", needed by: velocity-animate/velocity.ui".

Message repeated twice in the build output:

 ------- 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

Project is configured to use Typescript. I have installed npm packages "aurelia-animator-velocity" and "velocity-animate". I try to include velocity.ui but I'm only guessing how to do it below.

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);
  }
}
1

1 Answers

0
votes

I found the workaround. Also, extra characters.