Don't you need to specify that **jquery** is a dependency of **jqueryui** in the shim config? Something like this:

```javascript
shim: {
    'jquery': {
        'exports': '$'
    },
    'jqueryui': {
        'deps': ['jquery']
    },
    'lodash': {
        'exports': '_'
    }
} 
```