The jquery-ui
package does not contain a built-in version of jquery-ui, as far as I can tell. I finally got this working using jquery-ui-dist
package which includes jquery-ui.js and jquery-ui.css files by default.
npm install jquery-ui-dist
Now add aurelia.json depending on the provider:
"dependencies": [ "aurelia-binding", ... "jquery", { "name": "jquery-ui-dist", "path": "../node_modules/jquery-ui-dist", "main": "jquery-ui", "deps": ["jquery"], "resources": [ "jquery-ui.css" ] }, ]
Note that loading jquery first. The "main" attribute reports that it should load jquery-ui.js from this directory. The deps attribute indicates that it is dependent on jquery. Finally, the "resources" attribute includes jquery-ui.css by default.
Now in app.html be sure to specify the css file:
<require from="jquery-ui-dist/jquery-ui.css"></require>
For use in the ts file:
import * as $ from 'jquery'; import 'jquery-ui-dist';
source share