Hi again!
Another question about ShopWare6.
I try to install some dependencies via NPM to my Shopware. I use this instruction:
https://www.shopware.com/en/news/installing-your-own-dependencies-via-npm/
and it works with „missionlog“ module.
I wish to install swiper from https://swiperjs.com/. My steps:
- Go to /src/Resources/app/storefront
- Run: npm init -y
- Installing the package: npm install --save swiper
- Create file: /src/Resources/app/storefront/build/webpack.config.js with content:
const { join, resolve } = require('path');
module.exports = () => {
return {
resolve: {
alias: {
'@swiper': resolve(
join(__dirname, '..', 'node_modules', 'swiper')
)
}
}
};
}
- In my js file import swiper:
import Plugin from 'src/plugin-system/plugin.class';
import { Swiper } from '@swiper';
- Run: ./psh.phar storefront:build from my root directory.
But after that I got errors:
Module not found: Error: Can’t resolve ‚dom7‘ in '/src/Resources/app/storefront/node_modules/swiper/shared
and
Module not found: Error: Can’t resolve ‚ssr-window‘ in ‚/src/Resources/app/storefront/node_modules/swiper/core‘
Second one repeats 21 times with different files and pathes from /swiper/ dir.
Thanks a lot for any help!