angular-ui / ui-sortable

jQuery UI Sortable for AngularJS
http://angular-ui.github.io/ui-sortable/
MIT License
1.26k stars 443 forks source link

Weback support #478

Closed dhoomm closed 8 years ago

dhoomm commented 8 years ago

I installed using bower, but webpack fails to find the module. I had to add an index.js file with contents: require('./sortable.js'); module.exports = 'ui.sortable';

thgreasi commented 8 years ago

How about webpack shimming? Did you give it a try?

SpencerCarstens commented 8 years ago
import 'angular-ui-sortable';

angular
  .module( 'whatever', [
    // ...
    'ui.sortable',
    // ...
thgreasi commented 8 years ago

@SpencerCarstens I guess that the above solves the issue when using npm. I'm I right? Are you using any extra webpack config or plugins? Bower probably need some configuration though.

SpencerCarstens commented 8 years ago

The above example was using npm, correct.

https://webpack.github.io/docs/usage-with-bower.html

angular
  .module( 'whatever', [
    // ...
    require( 'angular-ui-sortable' ),
    // ...

That should also work if you are not using Babel...

thgreasi commented 8 years ago

Thanks for the detailed feedback! This will probably be proven useful for many devs. Closing this for now, feel free to comment or reopen in any case.

Reply to this email directly, view it on GitHub https://github.com/angular-ui/ui-sortable/issues/478#issuecomment-234763520, or mute the thread https://github.com/notifications/unsubscribe-auth/ABPF1TywVx-8xVjhaTypcvHCkWDyTcIcks5qYxoNgaJpZM4JSoGk .

Thodoris Greasidis