Installation
This one package will let you use jquery
and jquery-ui
(v.1.12.1, for jQuery1.7+) in your project.
Use npm install webpack-jquery-ui
instead of installing all dependencies and loaders separately.
Configuration
webpack.config.js
file
your - set the following loaders and plugins that are necessary to support
jquery
const path = ;const webpack = ;moduleexports = entry: index:'./src/index.js' output: filename: 'bundled.js' path: path publicPath:'dist/' module: rules: test: /\.css$/ loaders: "style-loader""css-loader" test: /\.$/i loader:"file-loader" options: name:'[name].[ext]' outputPath:'assets/images/' //the images will be emited to dist/assets/images/ folder plugins: /* Use the ProvidePlugin constructor to inject jquery implicit globals */ $: "jquery" jQuery: "jquery" "window.jQuery": "jquery'" "window.$": "jquery" ;
index.js
file
your entry To load all jquery-ui
features with its basic css theme use:
;; //ommit, if you don't want to load basic css theme
To load only jquery-ui
interactions or widgets or effects [list of features] use:
don't worry about jquery-ui core files. All neccessary dependencies are automatically loaded
;;;
To load only particular interactions [list of interactions] use:
don't worry about jquery-ui core files. All neccessary dependencies are automatically loaded with chosen interaction feature
;;;;;
To load only particular widgets [list of widgets] use:
don't worry about jquery-ui core files. All neccessary dependencies are automatically loaded with chosen widget
;;;;;;;;;;;;;;
To load only particular effects [list of effects] use:
don't worry about jquery-ui core files. All neccessary dependencies are automatically loaded with chosen effect
;;;;;;;;;;;;;;;