react-id-swiper icon indicating copy to clipboard operation
react-id-swiper copied to clipboard

Tree shaking?

Open Danetag opened this issue 4 years ago • 2 comments

Hey there!

Right now, when building chunks, the swiper library is fully built, which results in a huge chunk.

Screen Shot 2020-08-05 at 10 57 53 AM

Is there anything we can do in the webpack configuration to tree shake this?

Thanks!

Danetag avatar Aug 05 '20 14:08 Danetag

This works for me https://react-id-swiper.ashernguyen.site/doc/custom-build

johnmagbag1995 avatar Aug 28 '20 02:08 johnmagbag1995

The provides configuration (regex) doesn't work (it's not valid)

 module: {
    rules: [
      {
        exclude: [/node_modules/(?!(swiper|dom7)/).*/, /.test.js(x)?$/],
        test: /.js(x)?$/,
        use: [{ loader: 'babel-loader' }],
      }
    ],
  }

What exactly is the goal here? To exclude from the babel transpilation swiper and dom7 files?

Danetag avatar Aug 28 '20 17:08 Danetag