# jQuery Slim gegen jQuery tauschen

**URL:** <https://forum.shopware.com/t/jquery-slim-gegen-jquery-tauschen/68214>\
**Category:** Programmierung\
**Created:** [8. Juli 2020 um 12:35 UTC](https://forum.shopware.com/t/jquery-slim-gegen-jquery-tauschen/68214 "2020-07-08T12:35:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![inventivo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/inventivo/32/11397_2.png) [@inventivo](https://forum.shopware.com/u/inventivo)\
**Post date:** [8. Juli 2020 um 12:35 UTC](https://forum.shopware.com/t/jquery-slim-gegen-jquery-tauschen/68214/1 "2020-07-08T12:35:49Z")

</div>

Kann jemand einen (konkreten) Tipp geben, wie ich die jquery.slim.js gegen die volle jQuery Library tauschen kann?

Ich benötige vor allem animate()

---

<div class="post-metadata">

**Author:** ![EikeBrandtWarneke](https://avatars.discourse-cdn.com/v4/letter/e/cdc98d/32.png) [@EikeBrandtWarneke](https://forum.shopware.com/u/EikeBrandtWarneke)\
**Post date:** [8. Juli 2020 um 12:40 UTC](https://forum.shopware.com/t/jquery-slim-gegen-jquery-tauschen/68214/2 "2020-07-08T12:40:06Z")

</div>

Wenn es dir nur um animate geht:&nbsp;[http://youmightnotneedjquery.com/](http://youmightnotneedjquery.com/)  
Die library tauschen wird relativ schwierig - spätestens, wenn du noch andere Plugins im Shop hast.

Viele Grüße

---

<div class="post-metadata">

**Author:** ![UlrichThomasGabor](https://avatars.discourse-cdn.com/v4/letter/u/b4bc9f/32.png) [@UlrichThomasGabor](https://forum.shopware.com/u/UlrichThomasGabor)\
**Post date:** [3. Februar 2021 um 13:37 UTC](https://forum.shopware.com/t/jquery-slim-gegen-jquery-tauschen/68214/3 "2021-02-03T13:37:18Z")

</div>

Man kann die Webpack-Config von Shopware in einem Plugin anpassen. Standardmäßig ist das die Datei&nbsp;\_/src/Resources/app/storefront/build/webpack.config.js . \_Dort kann man dann das webpack-Plugin&nbsp;_NormalModuleReplacementPlugin_ benutzen, um alle Vorkommen von slim durch die volle Version zu ersetzen.

Im folgenden ein Beispiel.

So oder so ähnlich:

```
const path = require('path');
const projectRootPath = process.env.PROJECT_ROOT
    ? path.resolve(process.env.PROJECT_ROOT)
    : path.resolve('../../../../../../../');

const shopwarePlatformPath = projectRootPath + '/vendor/shopware/platform/';
const nodeModulesPlatformPath = shopwarePlatformPath + '/src/Storefront/Resources/app/storefront/node_modules/';

const shopwarePath = projectRootPath + '/vendor/shopware/';
const nodeModulesPath = shopwarePath + '/storefront/Resources/app/storefront/node_modules/';

let webpack = null;
let fullPath = null;
try {
  require.resolve("webpack");
  webpack = require('webpack');
} catch (e) {
  try {
    require.resolve(nodeModulesPlatformPath + "/webpack");
    webpack = require(nodeModulesPlatformPath + '/webpack');
    fullPath = nodeModulesPlatformPath;
  } catch (e) {
    require.resolve(nodeModulesPath + "/webpack");
    webpack = require(nodeModulesPath + '/webpack');
    fullPath = nodeModulesPath;
  }
}

let webpackConfig = {
  plugins: [
    new webpack.NormalModuleReplacementPlugin(
      /jquery\.slim/,
      fullPath + 'jquery/dist/jquery'
    )
  ],
};

module.exports = function () { return webpackConfig };

```

&nbsp;
