const path = require('path'); const webpack = require('webpack'); module.exports = { entry: { index: './index.js' }, output: { filename: 'bundled.js', path: path.resolve(__dirname, 'dist'), publicPath: '' }, module: { rules: [ { test: /\.css$/, loaders: ["style-loader","css-loader"] }, { test: { and: [ /\.(jpe?g|png|gif|svg)$/i, /jquery-ui/i ] }, loader: "file-loader", options: { name: '[name].[ext]', outputPath: 'assets/jquery-ui' } }, { test: { and: [ /\.(jpe?g|png|gif|svg)$/i, { not: [ /jquery-ui/i ] } ] }, loader: "file-loader", options: { name: '[path][name].[ext]', outputPath: 'assets/' } }, { test: /\.html$/i, loader: "file-loader", options: { name: '[path][name].[ext]', outputPath: '.', } } ] }, plugins: [ /* Use the ProvidePlugin constructor to inject jquery implicit globals */ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery'", "window.$": "jquery" }) ] };