Sortable: how to import sortable.js in ES6 module?

Created on 24 Aug 2018  路  2Comments  路  Source: SortableJS/Sortable

how to import sortable.js in ES6 module?

which one is the right import way?

import "sortable.js";
// import { Sortable } from "sortable.js";
// import * as Sortable from "sortable.js";

Most helpful comment

name bug

https://www.npmjs.com/package/sortablejs

sortablejs !== sortable.js

{
    "dependencies": {
        "sortablejs": "^1.7.0"
    }
}

// import "../libs/sortable";
// import "../libs/sortable.js";
// import * as Sortable from "../libs/sortable.js";// OK


// import "sortable";
// import { Sortable } from "sortable";// bug
// import { Sortable } from "sortablejs";// bug
import * as Sortable from "sortablejs";


// global export
window.Sortable = Sortable;

All 2 comments

name bug

https://www.npmjs.com/package/sortablejs

sortablejs !== sortable.js

{
    "dependencies": {
        "sortablejs": "^1.7.0"
    }
}

// import "../libs/sortable";
// import "../libs/sortable.js";
// import * as Sortable from "../libs/sortable.js";// OK


// import "sortable";
// import { Sortable } from "sortable";// bug
// import { Sortable } from "sortablejs";// bug
import * as Sortable from "sortablejs";


// global export
window.Sortable = Sortable;

close

Was this page helpful?
0 / 5 - 0 ratings