We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const webpack = require('webpack'); const path = require('path'); const HtmlWebPackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); module.exports = { module: { rules: [ { test: /\.scss$/, use: [ MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader" ] }, { type: 'javascript/auto', test: /\.js$/, exclude: /node_modules/, use: { loader: "babel-loader" } }, { test: /\.html$/, use: [{ loader: "html-loader", options: { minimize: false } }] }, { test:/\.(png|jpg|gif)$/, use:[{ loader:'file-loader', options:{ } }] } ] }, plugins: [ new webpack.ProvidePlugin({ '$': 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery', 'owl-carousel': 'owl-carousel.js' }), new HtmlWebPackPlugin({ template: "./src/index.html", filename: "./index.html" }), new MiniCssExtractPlugin({ filename: "[name].css", chunkFilename: "[id].css" }) ] };
import $ from 'jquery'; import jQuery from 'jquery'; import 'owl.carousel'; $(document).ready(function(){ $(".owl-carousel").owlCarousel(); });
JQuery version: 3.3.1 OwlCarousel version: 2.3.4 Webpack version: 4.16.5
The text was updated successfully, but these errors were encountered:
Try to add this in plugins: [] in webpack.config. It's work fine for me!
new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" })
Sorry, something went wrong.
No branches or pull requests
Uncaught TypeError: Cannot read property 'fn' of undefined
webpack.config.js
index.js
JQuery version: 3.3.1
OwlCarousel version: 2.3.4
Webpack version: 4.16.5
Note: jQuery is working correctly.
The text was updated successfully, but these errors were encountered: