jquery-ui-dist
and jquery-ui-bundle
do not seem to be maintained by the jquery-ui team. After jquery-ui v1.12 Its possible to use the official jquery-ui
package from npm with webpack.
Update jquery-ui to 1.12 by updating package.json
and npm install
.
Then you can require
each widget like this.
require("jquery-ui/ui/widgets/autocomplete");
require("jquery-ui/ui/widgets/draggable");
If you have used require("jquery-ui")
before you need to replace it with separate imports for each widget. I think the new way is better because it will bundle only the code for the widget we need to use.
See documentation on using the 1.12 official npm package.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…