cbmai
cbmai

Reputation: 11

How to use vueisotope plugin with Vue Webpack Template (currently getting an error)

Vue - Masonry/masonry dependency not found

I'm pretty new to Vue and and webpack and ran into an issue trying to use isotopes in my project that was built with this template. After installing and importing isotopes from vueisotope into a component I got the following error:

This dependency was not found: * masonry/masonry in ./node_modules/isotope-layout/js/layout-modes/masonry.js

This is an issue that a number of masonry users have encountered (see can't resolve masonry/masonry) and there is a recommended fix for it on metafizzy's website (the author of isotope). The recommended fix involves making changes to webpack.config.js and running webpack, but since this template has no webpack.config.js file and is built by running npm I've tried adding the line to /config/index.js and running npm run dev, with no success.

Upvotes: 0

Views: 408

Answers (1)

cbmai
cbmai

Reputation: 11

Got an answer from a contributer to the vue webpack template. I needed to add the aliases to build/webpack.base.conf.js:

module.exports = {
  ..
  resolve: {
    ..
    alias: {
      ..
      'masonry': 'masonry-layout',
      'isotope': 'isotope-layout'
    }
  }
};

Upvotes: 1

Related Questions