import $ from 'jquery';
import "isotope-layout";
var $grid = $(".our-design__gallery-items").isotope({
itemSelector: '.our-design__gallery-item',
});
$(".our-design__gallery-filters").on("click", "li", function(){
$grid.isotope({ filter: $(this).attr('data-filter') });
});
// webpack.config.js
var webpack = require('webpack');
module.exports = {
mode: 'development',
entry: './src/js/entry.js',
output: {
filename: 'bundle.js',
},
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /(node_modules)/,
loader: 'babel-loader',
query: {
presets: [
['env', {modules: false}],
],
},
},{
}
],
},
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
}),
],
devtool: 'source-map'
};
Uncaught TypeError: jquery__WEBPACK_IMPORTED_MODULE_0___default(...)(...).isotope is not a function
window.$ = window.jQuery = require('jquery');
window.isotope = require("isotope-layout/dist/isotope.pkgd");
var $grid = $(".our-design__gallery-items").isotope({
itemSelector: '.our-design__gallery-item',
transitionDuration: 500
});
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],